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]

0

1个回答

<#assign signDays = "${signDays}"/>
去掉这一行

0
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!