1、包含文件,並制定編碼格式
<#include "header.ftl" encoding="utf-8" />
2、判斷對象是否存在,並遍歷
<#if commonDtoList ??>
<#list commonDtoList as commonDto>
<a href="${commonDto.id}">${commonDto.name}</a>
<#if commonDto_has_next>
<span>>></span>
</#if>
</#list>
</#if>
3、將freemarker頁面中的整數轉變爲字符串
${id?c}
4、爲變量賦值
<#assign htmlDirDefault="filesDir">
5、爲變量指定默認值
${htmlDir!"filesDir"}