【发布时间】:2011-07-25 07:50:59
【问题描述】:
可以绑定一个字符串列表(List),并在jsp中的组合框中显示,如下所示:
<form:select path="countryId">
<form:option value="" label="Please Select"></form:option>
<form:options items="${countryList}" itemValue="countryId" itemLabel="countryName"/>
</form:select>
我希望此列表显示在 <td> 或 <form:input> 类似字段中,而不是组合框中。
我将模型中的字符串列表绑定为
Map referenceData = new HashMap();
referenceData.put("OutputsList", Outputs);
在 JSP 中我使用
<c:forEach var="OutputsList" items="${Outputs}">
${OutputsList}
</c:forEach>
但没有打印列表。可能是什么原因?
【问题讨论】:
标签: java forms spring jsp tags