我想从jsp格式的选定单选按钮获取值到我的servlet。如何在servlet中获取值,提前感谢任何帮助。
Jsp page is:
<table class="table" id="attendanceTableId" style="width: 500px;">
<%
for(int i=0;i<=se.size()-1;i++) {
%>
<tr>
<td><input type="textbox" name="studentName" value="<%=se.get(i)%>" style="background-color: #A7C5C2" readonly></td>
<td><input type="radio" name="status_<%= i %>" value="Present" style="width: 15px; height: 15px;" />Present
<input type="radio" name="status_<%= i %>" value="Absent" style="width: 15px; height: 15px;">Absent</td>
</tr>
<%
}
%>
</table>
答案 0 :(得分:0)
您希望将此值与您在表单
中实现的值相同public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
for(int i=0;i<=se.size()-1;i++) {
String Status = request.getParameter("status_"+i);
}
}