html标签先导入命名空间属性:xmlns:th="http://www.thymeleaf.org"
th:text="${hello}" 将标签的值设置为hello变量的值 行内写法[[]]
th:utext 不转义特殊字符 行内写法 [()]
th:text="*{hello}" *类似$符号 可以配合th:object使用
th:text="#{}" 获取国际化内容
th:href="@{/public/index.html?(key1=${val1},key2=${val2})}" 定义href地址
th:if="${not #strings.isEmpty(msg)}" 判断字符串变量msg是否为空
th:fragment="topbar" 抽取公共代码块 值为片段名
<div th:insert="~{dashboard::topbar}"></div> 插入公共代码块 使用代码来源模版名+片段名
<div th:replace="~{dashboard::#sidebar(name=val)}"></div>
~{} 可忽略 使用模版名+选择器名 可以传值
<div th:include="~{dashboard::topbar}"></div>
th:each="emp:${emps} 循环
${#dates.format(emp.birth,'yyyy-MM-dd HH:mm')}
时间转换 y:年 M:月 d:日 H:时 m:分 s:秒
th:attr="key=val" 给元素添加属性和值