【发布时间】:2014-06-23 16:26:38
【问题描述】:
我想设置默认value= ${theObject2.countryId}
<select id="locationCountry" style="padding-left: 2em" >
<option value="">Country</option>
<c:forEach items="${countrieDetail}" var="theObject" varStatus="theCount">
<option value="${theObject.countryId}" >${theObject.countryName}</option>
</c:forEach>
</select>
【问题讨论】:
-
你不能在你支持表单的模型属性中设置默认值吗?然后 Spring 将使用该值渲染组件。
-
为什么是 theObject2 ? “2”是错字吗?
标签: hibernate jsp spring-mvc combobox