<#list [1, 2, 3] as i>${i}</#list>
<#list list as i>${i}</#list>
<#list list + [1, 2, 3] as i>${i_index}${i}</#list>
<#list {"key": "value"}?keys as key>${key}</#list>
<#list map?keys as key>${key}${map[key]}</#list>
<#list (map + {"key": "value"})?values as value>${value}</#list>
<#list 1..10 as i>
${i}<#sep>,</#sep>
<#if !i_has_next></#if>
<#if i = 5><#break></#if>
</#list>
if
<#if num = 10></#if>
<#if num == 10></#if>
<#if num != 10></#if>
<#if num gt 10></#if>
<#if num gte 10></#if>
<#if num lt 10></#if>
<#if num lte 10></#if>
<#if num??>not null</#if>
<#if (num > 10)>
<#elseif (num < 10)>
<#else>
</#if>
POM
自动配置类为
FreeMarkerAutoConfiguration
,默认配置类为FreeMarkerProperties
自定义配置
src/main/resources/templates/test.ftlh
list
if
switch
attempt (try catch)
src/main/resources/templates/fragments.ftlh
include
import
国际化
手动渲染