我想在Freemarker 2.3.15的Map中迭代一个嵌套集合。如何在Freemarker中的Map中迭代嵌套集合?
我通过以下的观点:
Map<ApplicationPropertyDefinition, Collection<ApplicationProperty>> = getValues();
我已经尝试以下操作:
<#if propertiesByDefinition?size gt 0>
<#list propertiesByDefinition?keys as definition>
<strong>${definition.externalReference!''}</strong>
<#list propertiesByDefinition?values as value>
${value.name}
</#list>
</#list>
</#if>
错误:
Expected hash. value evaluated instead to freemarker.template.SimpleSequence on line 65, column 19 in templates/propertygroup/values.txt.
The problematic instruction:
----------
==> ${value.name} escaped ${(value.name!"")?html} [on line 65, column 17 in templates/propertygroup/values.txt]
----------
如何正确地遍历嵌套集合所以我可以访问每个ApplicationProperty对象中的字符串值“name”?