0

我有List<String>一个 Spring 的界限ModelAttribute。如何在 Freemarker 中对其进行迭代?

我试过了:

<#list ${modelattribute.listField} as thing >
    <tr><td>${thing}</td></tr></#list>
</#list>

但 Freemarker 并不期待转义序列

Encountered "{" at line 108, column 43 in things/search.html.
Was expecting one of: ...

我应该如何引用这个值?

4

1 回答 1

1

你应该这样做:

<#list modelattribute.listField as thing >
    <tr><td>${thing}</td></tr></#list>
</#list>
于 2013-01-24T05:08:06.163 回答