我正在尝试生成一个 Freemarker 模板,但我得到:
freemarker.template.TemplateException: Expected hash. ul evaluated instead to
freemarker.template.SimpleSequence on line 105, column 40
in Freemarker/MUC/UnitIndex.ftl.
我的课:
public class UnitLists extends TreeSet<UnitList>
...
添加到参数如下:
params.put("unitLists", this.unitLists);
...
在模板中使用:
<#list unitLists as ul>
<a href="${ul.linkFromRoot}" class="mya2">${ul.tag}</a>
</#list>
我究竟做错了什么?