freemarker模板语法

xiaoxiao2021-02-28  18

1.访问map中的key

${key}

2.访问pojo中的属性

Student对象。学号、姓名、年龄

${key.property}

3.取集合中的数据

<#list studentList as student> ${student.id}/${studnet.name} </#list>

4.取循环中的下标

<#list studentList as student> ${student_index} </#list>

5.判断

<#if student_index % 2 == 0> <#else> </#if>

6.日期类型格式化

7.Null值的处理

8.Include标签

<#include “模板名称”>

转载请注明原文地址: https://www.6miu.com/read-800134.html

最新回复(0)