freemarker的ftl页面的list标签一般都是循环集合,才不会报错,如果要像java的for那样循环特定的数字,就会报一下错误。
例如:循环4次
<#list 4 as t>
aa
</#list>
报错如下:
freemarker.template.TemplateException: Expected collection or sequence. field['${sub}'].head.colNumber default(4) evaluated instead to freemarker.template.SimpleNumber on line 11, column 112 in com/bxsurvey/sys/process/tabletemplate/tb_common_detail.ftl.
解决方法:
<#list 1..4 as t>
aa
</#list>
本文地址:http://www.yayihouse.com/yayishuwu/chapter/1069
向大家推荐《Activiti工作流实战教程》:https://xiaozhuanlan.com/activiti