我正在尝试使用值列表创建组合框,但在增强循环中出现错误...我的代码是
<body>
<% List<String> sexList = (List<String>)request.getAttribute("sexList"); %>
<% List<String> maritalStatus = (List<String>)request.getAttribute("maritalStatus"); %>
<form method="GET" action='FilterMembers'>
<table>
<tr>
<td>Genre:</td>
<td><select name="sex">
<%for(String item : sexList) { %>
<option value="<%=item%>"><%=item %></option><%}%>
</select>
</td>
</tr>
<tr>
<td>Marital Status:</td>
<td><select name="mStatus">
<%for(String item : maritalStatus) { %>
<option value="<%=item%>"><%=item %></option><%}%>
</select>
</td>
</tr>
<table>
</body>
</form>