thymeleaf
thymeleaf
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<p th:text="#{home.welcome}">welcome</p>
<p data-th-text="#{home.welcome}">welcome</p>
娈量表达式 ${}
消息表达式 #{}
选择表达式 *{} 在当前变量表达式中取值
链接表达式 @{} @{../} @{~/} @{//} @{http://}
分段表达式 th:insert th:replace th:include(不推荐使用)
文本 th:text
比较 >gt <lt >=ge <=le ==eq !=ne
无操作 _ ?:_
设置属性值 th:attr="action=@{/subscribe}"
迭代器 th:each <li th:each="book : ${books}" th:text="${book.title}">en</li>
状态变量 index(从0开始),count,size,current,even/odd(奇偶数),first,last
条件 th:if th:unless th:switch th:case
片段定义 <div th:fragment="copy"> <div th:insert="~{footer::copy}"></div>
<div id="copy"> <div th:insert="~{footer::#copy}"></div>
解析器级注释 <!--/* */-->
原型注释块 <!--/*/ /*/-->
内联表达式 [[]] th:text [()]th:utext 禁用内联 th:inline="none"
基本对象 #ctx #local #request #session #selrvletContext param/session/application
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect:3.0.0'