弹簧3 MVC文档指出选项标签,可以呈现:Spring MVC + FreeMarker:如何渲染选项标签?
<tr>
<td>Country:</td>
<td>
<form:select path="country">
<form:options items="${countryList}" itemValue="code" itemLabel="name"/>
</form:select>
</td>
</tr>
我使用的FreeMarker与Spring MVC,所以我将其解释为:
<tr>
<td>Place:</td>
<td>
<@form.select path="place">
<@form.options items="${places}" itemValue="id" itemLabel="name"/>
</@form.select>
</td>
</tr>
当我打的页面我得到以下异常:
freemarker.core.NonStringException: Error on line 40, column 73 in event.ftl
Expecting a string, date or number here, Expression places is instead a freemarker.template.SimpleSequence
我应该使用,而不是$ {}的地方在我的FreeMarker模板,这样上面的作品是什么?
谢谢。