直接用request.getParameter不行吗?

解决方案 »

  1.   

    <a href="/ListBugServlet?QUECD=<%=aSelectNewListStruct.getQUE_CD()%>&CLASSNAME=<%=aSelectNewListStruct.getCLASSONE_NAME()%>&SMALLNAME=<%=smallClass%>"  target="_self"><%=aSelectNewListStruct.getQUE_MNAME()%>&nbsp</a>request.getParameter("QUECD");
    request.getParameter("CLASSNAME");
      

  2.   

    我帮你,这样写:
    String[] str = (String[])request.getParameterValues("ControlName").我就是这样做的。
      

  3.   

    getParameterValues是对的,是个数组。
      

  4.   

    String[] str = (String[])request.getParameterValues("ControlName")
    取不到值,值没保存在"controlname"里面
                             
      

  5.   

    "controlname"是指你的控件名。比如
    String[] str = (String[])request.getParameterValues("CountryList").你再试试。如还不行,一定是你网页上有错误。
      

  6.   

    这个我知道,不是那个意思
    比如右边列表为<select name = "controlname" ......>这里没有传值</select>
    String[] str = (String[])request.getParameterValues("CountryList").这样不行
    你也是试了把左边的值传到右边列表框,然后
    String[] str = (String[])request.getParameterValues("controlname")吗
                             
      

  7.   

    是。首先:
    Code = document.form1.elements[leftlist].options[i].value;
    Text = document.form1.elements[leftlist].options[i].text然后:
    document.form1.elements[rightlist].options[j] = new Option(Text, Code);
      

  8.   

    function moveOver()
    {
        var boxLength = document.choiceForm.choiceBox.length;
        var selectedItem = document.choiceForm.available.selectedIndex;
        var selectedText = document.choiceForm.available.options[selectedItem].text;
        var selectedValue = document.choiceForm.available.options[selectedItem].value;
        var i;
        var isNew = true;
        if (boxLength != 0)
        {
          for (i = 0; i < boxLength; i++)
          {
            thisitem = document.choiceForm.choiceBox.options[i].text;
            if (thisitem == selectedText)
            {
            isNew = false;
            break;
            }
          }
        }
        if (isNew)
        {
          newoption = new Option(selectedText, selectedValue, false, false);
          document.choiceForm.choiceBox.options[boxLength] = newoption;
        }
          document.choiceForm.available.selectedIndex=-1;
    }---------------------
    String[] str = (String[])request.getParameterValues("choicebox")for (int i=0; i<str.length; i++)
        {out.println(str[i]);}
    str[i]是空值
                             
      

  9.   

    String[] str = (String[])request.getParameterValues("available")for (int i=0; i<str.length; i++)
        {out.println(str[i]);}
    试试?
      

  10.   

    String[] str = (String[])request.getParameterValues("available")for (int i=0; i<str.length; i++)
        {out.println(str[i]);}
    这样肯定是可以的,因为available是左边的列表框,有固定的值
    请问老兄你做的时候是怎么做的呢
                             
      

  11.   

    我怀疑你左边的列表框的值不对啊,呵呵。我的代码如下,你可试试。 function AddItem(ObjName, DesName, CatName)
    {

      //GET OBJECT ID AND DESTINATION OBJECT
      ObjID    = GetObjID(ObjName);
      DesObjID = GetObjID(DesName);
    //  window.alert(document.powersearch.elements[DesObjID].length);
      k=0;
      i = document.powersearch.elements[ObjID].options.length;
      if (i==0)
        return;
      maxselected=0
      for (h=0; h<i; h++)
         if (document.powersearch.elements[ObjID].options[h].selected ) {
             k=k+1;
             maxselected=h+1;
             }
      if (maxselected>=i)
         maxselected=0;

      if (CatName !="")
        CatObjID = GetObjID(CatName);
      else
        CatObjID = 0;
      if ( ObjID != -1 && DesObjID != -1 && CatObjID != -1 )
      { jj = document.powersearch.elements[CatObjID].selectedIndex;
        if ( CatName != "")
        { CatValue = document.powersearch.elements[CatObjID].options[jj].text;
          CatCode  = document.powersearch.elements[CatObjID].options[jj].value;
        }
        else
          CatValue ="";
        i = document.powersearch.elements[ObjID].options.length;
        j = document.powersearch.elements[DesObjID].options.length;
        for (h=0; h<i; h++)
        { if (document.powersearch.elements[ObjID].options[h].selected )
          {  Code = document.powersearch.elements[ObjID].options[h].value;
             Text = document.powersearch.elements[ObjID].options[h].text;
             j = document.powersearch.elements[DesObjID].options.length;
             if (Text.indexOf('--')!=-1) {
                for (k=j-1; k>=0; k-- ) {
                  document.powersearch.elements[DesObjID].options[k]=null;
                }
                j=0;
             }
             if (Text.substring(0,1)=='-' && Text.substring(1,2)!='-') {
                for (k=j-1; k>=0; k-- ) {
                  if (((document.powersearch.elements[DesObjID].options[k].value).substring(0,2))==(Code.substring(0,2)))
                     document.powersearch.elements[DesObjID].options[k]=null;
                }
                j= document.powersearch.elements[DesObjID].options.length;
             }
             HasSelected = false;
             for (k=0; k<j; k++ ) {
               if ((document.powersearch.elements[DesObjID].options[k].text).indexOf('--')!=-1){
                  HasSelected = true;
                  window.alert('已经包括本选项:'+Text);
                  break;
               }else if ((document.powersearch.elements[DesObjID].options[k].text).indexOf('-')!=-1 && ((document.powersearch.elements[DesObjID].options[k].value).substring(0,2)==Code.substring(0,2))){
                  HasSelected = true;
                  window.alert('已经包括本选项:'+Text);
                  break;
               }
               if (document.powersearch.elements[DesObjID].options[k].value == Code)
               {  HasSelected = true;
                  break;
               }
             }
             if ( HasSelected == false)
             { if (CatValue !=\"\")
               { Location = GetLocation(DesObjID, CatValue);
                 if ( Location == -1 )
                 { document.powersearch.elements[DesObjID].options[j] =  new Option(\"---\"+CatValue+\"---\",CatCode);
                   document.powersearch.elements[DesObjID].options[j+1] = new Option(Text, Code);
                 }//if
                 else
                 { InsertItem(DesObjID, Location+1);
                   document.powersearch.elements[DesObjID].options[Location+1] = new Option(Text, Code);
                 }//else
               }
               else
                 document.powersearch.elements[DesObjID].options[j] = new Option(Text, Code);
             }//if
             document.powersearch.elements[ObjID].options[h].selected =false;
           }//if
        }//for
        document.powersearch.elements[ObjID].options[maxselected].selected =true;
      }//if
    }//end of function
      

  12.   

    错了,是这样: function AddItem(ObjName, DesName, CatName)
    {

      //GET OBJECT ID AND DESTINATION OBJECT
      ObjID    = GetObjID(ObjName);
      DesObjID = GetObjID(DesName);
    //  window.alert(document.powersearch.elements[DesObjID].length);
      k=0;
      i = document.powersearch.elements[ObjID].options.length;
      if (i==0)
        return;
      maxselected=0
      for (h=0; h<i; h++)
         if (document.powersearch.elements[ObjID].options[h].selected ) {
             k=k+1;
             maxselected=h+1;
             }
      if (maxselected>=i)
         maxselected=0;

      if (CatName !="")
        CatObjID = GetObjID(CatName);
      else
        CatObjID = 0;
      if ( ObjID != -1 && DesObjID != -1 && CatObjID != -1 )
      { jj = document.powersearch.elements[CatObjID].selectedIndex;
        if ( CatName != "")
        { CatValue = document.powersearch.elements[CatObjID].options[jj].text;
          CatCode  = document.powersearch.elements[CatObjID].options[jj].value;
        }
        else
          CatValue ="";
        i = document.powersearch.elements[ObjID].options.length;
        j = document.powersearch.elements[DesObjID].options.length;
        for (h=0; h<i; h++)
        { if (document.powersearch.elements[ObjID].options[h].selected )
          {  Code = document.powersearch.elements[ObjID].options[h].value;
             Text = document.powersearch.elements[ObjID].options[h].text;
             j = document.powersearch.elements[DesObjID].options.length;
             if (Text.indexOf('--')!=-1) {
                for (k=j-1; k>=0; k-- ) {
                  document.powersearch.elements[DesObjID].options[k]=null;
                }
                j=0;
             }
             if (Text.substring(0,1)=='-' && Text.substring(1,2)!='-') {
                for (k=j-1; k>=0; k-- ) {
                  if (((document.powersearch.elements[DesObjID].options[k].value).substring(0,2))==(Code.substring(0,2)))
                     document.powersearch.elements[DesObjID].options[k]=null;
                }
                j= document.powersearch.elements[DesObjID].options.length;
             }
             HasSelected = false;
             for (k=0; k<j; k++ ) {
               if ((document.powersearch.elements[DesObjID].options[k].text).indexOf('--')!=-1){
                  HasSelected = true;
                  window.alert('已经包括本选项:'+Text);
                  break;
               }else if ((document.powersearch.elements[DesObjID].options[k].text).indexOf('-')!=-1 && ((document.powersearch.elements[DesObjID].options[k].value).substring(0,2)==Code.substring(0,2))){
                  HasSelected = true;
                  window.alert('已经包括本选项:'+Text);
                  break;
               }
               if (document.powersearch.elements[DesObjID].options[k].value == Code)
               {  HasSelected = true;
                  break;
               }
             }
             if ( HasSelected == false)
             { if (CatValue !="")
               { Location = GetLocation(DesObjID, CatValue);
                 if ( Location == -1 )
                 { document.powersearch.elements[DesObjID].options[j] =  new Option("---"+CatValue+"---",CatCode);
                   document.powersearch.elements[DesObjID].options[j+1] = new Option(Text, Code);
                 }//if
                 else
                 { InsertItem(DesObjID, Location+1);
                   document.powersearch.elements[DesObjID].options[Location+1] = new Option(Text, Code);
                 }//else
               }
               else
                 document.powersearch.elements[DesObjID].options[j] = new Option(Text, Code);
             }//if
             document.powersearch.elements[ObjID].options[h].selected =false;
           }//if
        }//for
        document.powersearch.elements[ObjID].options[maxselected].selected =true;
      }//if
    }//end of function