【发布时间】:2015-03-31 10:00:54
【问题描述】:
这里的问题是我将 index 和 c 作为评估表达式,在评估 index[1] 之后,它将作为 userDetails 的参数。因此,例如比如c.firstname。
<#ftl encoding='UTF-8'>
<#list param?chunk(3) as index>
<#list userDetails as c>
${c.index[1]}
</#list>
</#list>
但是,我假设 Freemarker 正在同时评估所有表达式,因此在运行这段代码时,index[1] 尚未评估。因此,我得到了这个错误。
FreeMarker template error:
The following has evaluated to null or missing:
==> c.index [in template "src/template_fixedlength.ftl" at line 5, column 19]
你们中有人知道这个问题的任何解决方法吗?
提前致谢!
【问题讨论】:
标签: freemarker