Thymeleaf
资料
使用
不重启编辑网页:设置成cache=false
URL的处理是通过语法@{...}来处理
<a th:href="@{http://www.thymeleaf.org}">Thymeleaf</a>字符串替换
- 局部:
<span th:text="|Welcome to our application, ${user.name}!|"> th:href="|mailto:${text_email}|" - 全部:
th:href="${jsFile}"
- 局部:
自定义属性
<div th:attr="selfdefineAttr=${xxx}"></div><div th:attr="style='background-image:url('+${banner.pic}+')'"></div><div th:style="'background-image:url('+${banner.pic}+')'"></div>
直接显示html
<div th:remove="tag" th:utext="${content}"></div><%==content%>。单个=是值,两个=是html显示