Freemarker common syntax

①: Restrict the value of the field to be taken out: from the 0th bit to the 2nd bit.

[0..2]


②: Take out the first 3 pieces of data in the list through _index.

<#if (list_index < 3) >

</#if>


③: Traverse the list.

<#list  studentList as sut>

${stu.name}

</#list>


④: if-else-if statement format.

<#if (condition)>

<#elseif (condition)>

<#else>

</if>


⑤: Introduce the page.

<#include "header.html"/>


⑥: Define variables.

<#assign i = 1/>


⑦: Determine whether it is empty.

student??


⑧: Use "-" instead of empty.

${stu.name!"-"}



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325548282&siteId=291194637