如图:
我想要依次得到选择,判断的勾选情况,以便按顺序存进数据库。但因为前面jsp页面是使用这种方式即所有name属性都不是确定的。我在后台就使用 HttpServletRequest request = getRequest();
Enumeration<String> enumeration = request.getParameterNames();
while(enumeration.hasMoreElements()){
        String key = enumeration.nextElement();
if(key.startsWith("radio")){  //选择题
id = StringUtils.substringAfter(key, "radio");
choiceValue = request.getParameterValues(key);  //因为有可能是多选,所以用getParameterValues
         if(choiceValue.length==1){     //单选的时候
 answer_Radio = choiceValue[0];
}else{ //多选的时候
for(String choice:choiceValue){
answer_Radio += choice+",";   //多选选项间以,分隔
}
                  }
if(answer_Radio.endsWith(",")){        //如果是多选以,结尾 则最终结果去掉结尾的,
       answer_Radio = answer_Radio.substring(0, answer_Radio.length()-1);
}
answerRadio += answer_Radio+"***";  //answerRadio是存放全部答案的字符串 
      }   

//问题就在于存答案时候,因为前面得到key是无序的,可能第二题先进来,这么存放的答案就变为第一题的答案了。
// 求解决方案,在线等~~~~