FTL中常用说明

来源:互联网 发布:商城虚拟商品数据库 编辑:程序博客网 时间:2024/05/04 01:03

一、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-dd")}</#if> 


五、FreeMarker 对 substring 默认支持

${string[0..4]}               <!-- 截取 0-4 个字符 -->



六、Ofbiz Form







         





     







0 0