创建增强的for循环时出现apache tomcat错误

时间:2014-10-23 18:01:18

标签: java jsp tomcat java-ee

我正在尝试使用值列表创建组合框,但在增强循环中出现错误...我的代码是

<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>

0 个答案:

没有答案