用request.getParameterValues("");
返回的是一个数组

解决方案 »

  1.   

    一组checkbox,你选中了几个,
    返回的就有几个值,
    这些值放在一个字符串数组中,
    即:String[] aStrData = request.getParameterValues("checkboxName");
      

  2.   

    这一组数组的name都必须一样吗?跟radio按钮性质一样?
      

  3.   

    <input type="checkbox" name="Cid" value="值">//这是传过来的value的值
    String[] id = request.getParameterValues("Cid");for(int i=0;i<id.length;i++){
      out.println(id[i]);
    }
      

  4.   

    给你一段代码,你试验一下:
    <form action = "b.jsp" name ="form1">
    <input type = "checkbox" name = "checkbox" value ="0">apple
    <input type ="checkbox" name = "checkbox" value = "1">banana
    <input type = "checkbox" name = "checkbox" value = "2">orange
    <input type = "button" value= "提交" onclick= "form1.submit()">
    在b.jsp页面中:
     String[] mm=  request.getparametervalues(checkbox);
     for(inti=0,i<mm.length;i++){
      out.println("check  "+mm[i]);

    其中mm[i]就是你选择 的对象 
    给你提供个思想,代码是我自己写的,有可能有点语法错误,不太碍事!