日期:2014-05-17  浏览次数:20771 次

<logic:iterate>取值问题?
<logic:iterate id="exam" name="stu_exam_list" type="com.aftvc.exam.entity.Exam" indexId="s" >
  <h3>第<%= s+1 %> 题</h3>
 <table width="600" border="0" cellpadding="0" cellspacing="0">
  <tr>
  <td colspan="2" align="left"><span class="conList"><strong>${exam.sq_question }<input type="hidden" name="sq_id" ></strong></span></td>
  </tr>
  <tr>
  <td width="31" align="right">(A)</td>
  <td width="559" align="left">&nbsp;${exam.sq_question_A}</td>
  </tr>
  <tr>
  <td align="right">(B)</td>
  <td align="left">&nbsp;${exam.sq_question_B}</td>
  </tr>
  <tr>
  <td align="right">(C)</td>
  <td align="left">&nbsp;${exam.sq_question_C}</td>
  </tr>
  <tr>
  <td align="right">(D)</td>
  <td align="left">&nbsp;${exam.sq_question_D}</td>
  </tr>
  </table>
<table width="760" border="0">
  <tr>
  <td><div align="left"><strong><span class="conList">选择答案:</span>   <span class="conList">A</span>
  <input type="radio" name="${exam.sq_id}" value="radiobutton" />  
  <span class="conList"> B</span>
  <input type="radio" name="${exam.sq_id}" value="radiobutton" /> 
  <span class="conList"> C</span>
  <input type="radio" name="${exam.sq_id}" value="radiobutton" /> 
  <span class="conList">
  D</span>
  <input type="radio" name="${exam.sq_id}" value="radiobutton" />
  </strong></div></td>
  </tr>
  </table>怎么在Action中
读取回答过的问题内容,答案
public ActionForward Stu_exam_answer(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws IOException {
PrintWriter out = response.getWriter();
ExamForm examForm = (ExamForm) form;// TODO Auto-generated method stub
String answer=request.getParameter("stu_exam_list"); System.out.println(answer);
if(answer==null){
out.print("<script>confirm('还有未选择的试题,确定交卷么?')</script>");
}
else{
request.setAttribute("stu_exam_answerlist", answer);
return mapping.findForward("stu_exam_answer");
}
return mapping.findForward("stu_exam_answer");
}不正确,请问怎么改显示一组数据?谢谢!


------解决方案--------------------
你这个是要接收所有隐藏表单的值吧?
难道你不打算用数组接收?

String[] param= request.getParameterValues("sq_id");