thymeleaf common

<html lang="en" xmlns:th="http://www.thymeleaf.org">

* Text text differences

<!--区别一个不可以解析标签,-->
<h1 th:text="${title}">欢迎</h1>
<!--区别一个可解析标签-->
<h1 th:utext="${title}">欢迎</h1>

* Cycle to get the value of text

<h3 th:each="name:${data}" th:text="${name}">在这显示名字</h3>

* Handle URLs

<a href="" th:href="@{/user}">点我</a>

* connected to a tag written
configuring universal addresses in the configuration file

server.servlet.context-path=/dev

a label is automatically preceded by the address

<!--连接写法-->
<!--这种写法会在前面自动拼接context-path-->
<a href="" th:href="@{/dep/list}">对的链接/dep/list</a>

* Form form

<form action="" th:action="@{/user}">
    <input type="text" name="" th:value="${name}">
</form>

*fragment 与replace, include

fragment was written to create a common fragment of html special write it
`` `

<h1>首页</h1>
在其他页面调取

:replace 与include 的区别

```

Guess you like

Origin www.cnblogs.com/lxx-1843693653/p/11110602.html