一、FTL常用对象
sessionAttribute、requestAttributes、requestParameters
二、FTL中类的调用方法
<#assign nowTimestamp=Static["org.ofbiz.base.util.UtilDateTime"].nowTimestamp()>
三、遍历listⅩ,得到摸个对象在list中的序号,是从0开始计数
<#list productList as product>
<span style="white-space:pre"> </span>${product_index}
</#list>
四、格式化日期
<!-- 建议要作判断,不然容易出错-->
<#if
(orderHeader.orderDate )?has_content)>${orderHeader.orderDate?string("yyyy-MM-d
d")}</#if>
五、FreeMarker 对 substring 默认支持
${string[0..4]} <!-- 截取 0-4 个字符 -->
六、Ofbiz Form