用struts1 做 表格 通过一个jsp页面(有两个下拉列表 列数:行数:)下边有一个提交按钮
根据所选行数列数 跳转另一个jsp页面 显示一个多行多列的表格 表格中用“*”;

解决方案 »

  1.   

    first.jsp
       <select id="hs" name="hs">
             <option value="1">1行</option>
             <option value="2">2行</option>
             
       </select>
       <select id="ls" name="ls">
             <option value="1">1列</option>
             <option value="2">2列</option>
             
       </select>  通过form提交到下个JSP(second.jsp)
      <table>
      <%
      int hs=Integer.parseInt(request.getparameter("hs").toString);
          for(int i=0;i<hs;i++)
         {
             %>
           <tr>
              <%
                int ls=Integer.parseInt(request.getparameter("ls").toString);
                for(int j=0;j<ls;j++)
                 {%>
                 <td>*</td>
             <%
                 }
            %>
             
          </tr>     <%
          out.println("<tr>");
         }
       %>
          
      </table>   没有测试,反正大体上这样应该可以实现。
      

  2.   

    不用写继承action的那个吗?
      

  3.   

    int ls=Integer.parseInt(request.getparameter("ls").toString);
    这个是什么意思啊?