我这个要在一个页面中显示,不能弄几个页面分别SUBMIT的

解决方案 »

  1.   

    昨天有一个类似的问题,怎么不找一下参考呢。
    http://community.csdn.net/Expert/topic/4012/4012801.xml?temp=.6797907
      

  2.   

    找了,但是我觉得那个没有解决我需要的问题啊,现在关键是在JSP页面要取数据库的数据怎么取,直接在JSP页面用JDBC也太不规范了吧
      

  3.   

    可以调用javaBean来取数据嘛,返回ArrayList.
      

  4.   

    我着有一个二级菜单  用的是脚本语言  没有整理 <script type="text/javascript"> 
    var onecount; 
    onecount=0; 
    subcat = new Array(); 
            <% 
            int count = 0; 
            while(rs.next()){ 
            %> 
    subcat[<%=count%>] = new Array("<%=rs.getString("xm")%>","<%=rs.getString("xh")%>","<%=rs.getInt("bid")%>"); 
            <% 
            count++; 
            } 
            rs.close(); 
            %> 
    onecount=<%=count%>; 
    <!--决定select显示的函数--> 
    function changelocation(locationid) 
        { 
        document.myform.NclassId.length = 0;     var locationid=locationid; 
        var i; 
        for (i=0;i < onecount; i++) 
            { 
                if (subcat[i][2] == locationid) 
                { 
                    document.myform.NclassId.options[document.myform.NclassId.length] = new Option(subcat[i][0], subcat[i][1]); 
                }        
            } 
            
        }    
    </script> <FORM method="POST" name="myform" action="in_message.jsp" onSubmit="return CheckForm();">    
        <TR> 
          <TD bgcolor="#FFFFFF"><p align="center">&nbsp;
            </p>
            <table width="469" border="0" align="center">
              <tr>
                <th width="463" background="Images/techer_table.gif" scope="col"><p class="style1">教 师 留言</p>            </th>
              </tr>
              <tr>
                <th scope="row"><p>&nbsp;</p>
                  <p>题目:
                    <input name="title" type="text" id="title" size="30">
    </p>
                  <p align="right" class="style3"> (最多50字符)</p></th>
              </tr>
              <tr>
                <th scope="row"><p>&nbsp;</p>
                <p>内容:
                  <textarea name="context" cols="30" rows="5" id="textarea"></textarea>
                  </p>
                <p align="right"><span class="style3">(最多100字符)</span></p></th>
              </tr>
              <tr>
                <th scope="row"><p>&nbsp;</p>
                  <p>留言:               
                    <input name="type" type="radio" value="0" checked> 
                  评语: 
                  <input type="radio" name="type" value="1"> 
                  </p></th>
              </tr>
              <tr>
                <th scope="row"><p>&nbsp;</p>
                  <p>班级:
                    <select name="classId" onChange="changelocation(document.myform.classId.options[document.myform.classId.selectedIndex].value)" size="1">
                      <option value="value" selected>==请选您代的班级==</option>
                      <%  
    //从teacher,xs,banji 三表中获得此教师所带的班级  
    String c_stu="select * from java.zhuanye ,java.banji,java.nianji where java.banji.zid=java.zhuanye.zid and java.zhuanye.nid=java.nianji.nid and java.zhuanye.zid=any( select distinct zid from java.banji where  java.banji.bid=any(select distinct bid from java.xs where jsh='"+session.getValue("jsh")+"')) and java.zhuanye.nid=any(select distinct nid from java.zhuanye where zid=any(select zid from java.banji where  java.banji.bid=any(select distinct bid from java.xs where jsh='"+session.getValue("jsh")+"'))) " ;

     ResultSet rs2=a.executeQuery(c_stu);
      while (rs2.next())  {     //     
    %>
                      <option value="<%= rs2.getInt("bid")%>"> <%=rs2.getString("nj")+rs2.getString("zym")+rs2.getString("bjm")%></option>
                      <%
    }
      rs2.close();
    a.closestatement();
      a.closemyconn(); 
     
      %>
                    </select>
                  </p></th>
              </tr>
              <tr>
                <th scope="row"><p>&nbsp;</p>
                  <p>收件人:
                    <SELECT name="NclassId">
                      <option selected>==请选学生==</option>
                    </SELECT>
                </p></th>
              </tr>
              <tr>
                <th height="33" scope="row">
                  <p>&nbsp;              </p>
                  <p>
                    <input type="submit" name="Submit" value="提交留言">
                  </p>
                <p>&nbsp;              </p></th>
              </tr>
              <tr>
                <th height="25" background="Images/techer_table.gif" scope="row">&nbsp;</th>
              </tr>
            </table>
            
    </FORM>
      

  5.   

    有struts,基本上不简单,只用过JSP+JAVASCRIPT
      

  6.   

    对于select  onchange的时候就让form submit一次  来决定子项目的内容  或者一次load全部数据到客户端 然后通过javascript来操作 select控件  
    但是这种方法 javascript的代码量 实在太多
      

  7.   

    使用javascript,选择一次下拉框就刷新一次页面,这样子代码也不会很多