这工作正常:
<#list myObjects as myObject>
<tr>
<td>${myObject.person.surname}</td>
<td>${myObject.myListOfCountries[0].city.name}</td>
</tr>
</#list>
但是,如果我尝试像这样创建一个嵌套列表,这不起作用:
<#list myObjects as myObject>
<tr>
<td>${myObject.person.surname}</td>
<#list myObject.myListOfCountries as item>
<td>${item.city.name</td>
</#list>
</tr>
</#list>
我收到的错误如下所示:
freemarker.core.ParseException: Encountered "/"
任何导致错误的想法 - freemarker 中是否允许嵌套列表?