java.util.Enumeration mystr=request.getParameterNames();
  int i;
  try{
    while(mystr.hasMoreElements()){
      String e=mystr.nextElement().toString();
      if(e.indexOf("group")==-1) {
        String[] add=request.getParameterValues(e);
        for(i=0;i<address.length;i++) myaddr.addaddr(add[i]);
    }
  }
  }catch(Exception e){
    System.err.println(e.getMessage());
  }

解决方案 »

  1.   


    <%@ page contentType="text/html;charset=gb2312"%>
    <%@ page language="java"%>
    <%@ page import="java.sql.*"%>
    <jsp:useBean id="show" scope="page" class="com.tomato.forumDB.forumDB"/>
    <html>
    <head>
    <title>顶级栏目次序调整</title>
    <SCRIPT language=javascript>
    function mysubmit(form)
    {
    with(form){
    selectValue.value=''
    for(i=1;i<s1.length;i++)
    selectValue.value+=s1.options[i].value+','
    }
    }
    function moveUp(obj)
    {
    with (obj){
    if(selectedIndex==1){
    options[length]=new Option(options[1].text,options[1].value)
    options[1]=null
    selectedIndex=length-1
    }
    else if(selectedIndex>1) moveG(obj,-1)
    }
    }
    function moveDown(obj)
    {
    with (obj){
    if(selectedIndex==length-1){
    var otext=options[selectedIndex].text
    var ovalue=options[selectedIndex].value
    for(i=selectedIndex; i>1; i--){
    options[i].text=options[i-1].text
    options[i].value=options[i-1].value
    }
    options[i].text=otext
    options[i].value=ovalue
    selectedIndex=1
    }
    else if(selectedIndex>0 && selectedIndex<length-1) moveG(obj,+1)
    }
    }
    function moveG(obj,offset)
    {
    with (obj){
    desIndex=selectedIndex+offset
    var otext=options[desIndex].text
    var ovalue=options[desIndex].value
    options[desIndex].text=options[selectedIndex].text
    options[desIndex].value=options[selectedIndex].value
    options[selectedIndex].text=otext
    options[selectedIndex].value=ovalue
    selectedIndex=desIndex
    }
    }
    </SCRIPT>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <link rel=stylesheet href="styles.css" type=text/css>
    </head><body bgcolor="#FFFFFF" text="#000000" topmargin="0" marginheight="0">
    <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
      <tr> 
        <td bgcolor="#F7F7F7"> 
          <table width="100%" border="0" cellspacing="0" cellpadding="0" class="txt">
            <tr> 
              <td height="19">顶级栏目管理 </td>
            </tr>
          </table>
        </td>
      </tr>
      <tr> 
        <td height="15"> 
          <form  method="post" name=shezhi onsubmit=mysubmit(this) action="/servlet/com.tomato.servlets.subject.getNewOrder">
            <table width="100%" border="0" cellspacing="1" cellpadding="1" bgcolor="#33CCFF">
              <tr> 
                <td width="30%" bgcolor="#E8F8FF"> 
                  <div align="center"> 
                    <select name="s1" size="9">
                      <option value="-1">-----------------</option>
                      <%
      ResultSet rs=show.executeQuery("select * from class order by orderby");
      while(rs.next())
      {
      %>
                      <option value="<%=rs.getString("ztid")%>"><%=rs.getString("class")%></option>
                      <%
    }
    show.destroy();
    %>
                    </select>
                  </div>
                </td>
                <td width="70%" bgcolor="#E8F8FF"> 
                  <input type="button" onclick=moveUp(this.form.s1) value="∧">
                  <input name=selectValue  type=hidden value=with(this)>
                  <input 
          name=netColumnid type=hidden value=15>
                  <input name=netMagazineid 
          type=hidden value=1>
                  <input name=totalNum type=hidden value=1>
                  <br>
                  <br>
                  <input type="button" onclick=moveDown(this.form.s1) value="∨">
                  <br>
                  <br>
                  <input type="submit" name="Submit" value="保存">
                  <br>
                  <br>
                  <input type="button" value="关闭窗口" onclick="window.close();">
                </td>
              </tr>
            </table>
          </form>
        </td>
      </tr>
     
    </table>
    </body>
    </html>以上是我的程序,我自己来结了吧