jsp:
<form action="test" method="get">
<input name="test" type="checkbox" value="1"/>A<input type="hidden" name="1" value="A" /><BR>
<input name="test" type="checkbox" value="2"/>B<input type="hidden" name="2" value="B" /><BR>
<input name="test" type="checkbox" value="3"/>C<input type="hidden" name="3" value="C" /><BR>
<input name="test" type="checkbox" value="4"/>D<input type="hidden" name="4" value="D" /><BR>
<input type="submit" value="Submit" />
</p>
</form>
Servlet:
public void doGet(HttpServletRequest request,HttpServletResponse response) throws IOException{
String[] parms=request.getParameterValues("test");
for(int i=0;i<parms.length;i++){
String value=request.getParameter(parms[i]);
System.out.println("======id======="+value);
}
}