2 qq 35427872 qq_35427872 于 2017.09.14 09:40 提问

freemarker #assign 问题

java后端:
List signDays = new ArrayList();
...list.add("1")
list.add("2")...
request.setAttribute("signDays", signDays);

用了freemarker 的前端:
<#assign num = "${l}"/>
<#assign signDays = "${signDays}"/>
<#if signDays?seq_contains(num)>

我反复看了 很多遍 感觉没错

最后报错:
[ERROR] 09:24:44.152 [http-apr-8088-exec-7] freemarker.runtime - Error executing FreeMarker template

freemarker.core.NonStringOrTemplateOutputException: For "${...}" content: Expected a string or something automatically convertible to string (number, date or boolean), or "template output" , but this has evaluated to a sequence (wrapper: f.t.SimpleSequence):

==> signDays [in template "point/point.htm" at line 72, column 88]

Csdn user default icon
上传中...
上传图片
插入图片