有时候freemarker中需要将后台传来的list数据进行筛选,这样会想到定义变量
<#assign x=0 /> <#list list as li> <#assign x=x+1 /> ${x} #list>