私は電子カウンセリングプロジェクトに取り組んでいます。一度に複数の支店や学校を選択できるようにしたいのですが、SelectedValues が常に null であることがわかりました。何が問題なのか教えてください。
<table border="1" cellpadding="0" cellspacing="0" >
<% for(i=0;i<branchSchools.length;i++){ %>
<tr class=<%= (i%2==0)?"rowstyle":"altrowstyle" %> >
<td>
<input type="checkbox" name="SelectedBranchSchool" id='SelectedBranchSchool<%= i %>' value="<%= i %>">
</td>
<td >
<%= branchSchools.item[i].branchCode %>
</td>
<td >
<%= branchSchools.item[i].school %>
</td>
<td align="right">
<form name="frm5" action="addMultipleChoiceFill" method="post">
<% request.getSession().setAttribute("BranchSchools",branchSchools);
request.getSession().setAttribute("FilledChoices",filledChoices);
%>
<input type="submit" name="addmult" value="AddMultiple"/>
</form>
</td>
![enter image description here][1]
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
BranchSchools branchSchools=null;
FilledChoices filledChoices=null;
branchSchools=(BranchSchools) request.getSession().getAttribute("BranchSchools");
request.getSession().removeAttribute("BranchSchools");
filledChoices=(FilledChoices)request.getSession().getAttribute("FilledChoices");
request.getSession().removeAttribute("FilledChoices");
String[] SelectedValues = request.getParameterValues("SelectedBranchSchool");
for(int i=0; i<SelectedValues.length; i++){
int k=Integer.valueOf(SelectedValues[i]);
filledChoices.addFilledChoice(branchSchools.item[k]);
branchSchools.removeBranchSchool(k);
}
request.setAttribute("BranchSchools",branchSchools);
request.setAttribute("FilledChoices",filledChoices);
request.setAttribute("Change", "yes");
RequestDispatcher rd=getServletContext().getRequestDispatcher("/choiceFill.jsp?");
rd.forward(request,response);