<div> <p> <td> <span> 后面加 th:text="${...}"
<h1 th:text="${user.getId()}"></h1>
<h1 th:text="${user.getUsername()}"></h1>
<h1 th:text="${user.getAge()}"></h1>
<h1 th:text="${user.username}"></h1>
<h1 th:text="${user.getAge()}"></h1>
<span th:text="${emp.id}"></span> <span th:text="${emp.name}"></span><br/>
<span th:text="${emp.address}"></span> <span th:text="${emp.salary}"></span><br/>
<input type=""/> type=text/password/textArea 后面加 th:value="${...}"赋值
th:selected selected选择框 选中 th:selected="(${xxx.id} == ${configObj.dd})"
链接: th:src="@{...}" th:href="@{...}" th:action="@{...}"
th:src 图片类地址引入 <img class="img-responsive" alt="App Logo" th:src="@{/img/logo.png}" />
绝对路径(不带参数):
<a th:href="@{http://localhost:8080/user/detail}">跳转至:/user/detail</a><br/>
绝对路径(带参数):
<a th:href="@{http://localhost:8080/test?username='zhangsan'}">路径表达式的写法</a><br/>
相对路径(不带参数):
<a th:href="@{/user/detail}">跳转至:/user/detail</a>
相对路径(带参数):
<a th:href="@{'/test?username='+${id}}">相对路径:获取后台参数值</a><br/>
<h2>相对路径(带多个参数:后台获取的参数)</h2>
<a th:href="@{'/test1?username='+${username}+'&id='+${id}+'&age='+${age}}">相对路径:获取后台参数值</a><br/>
<a th:href="@{/test1(id=${id},username=${username},age=${age})}">(强烈推荐)@{}相对路径(带多个参数:后台获取的参数值)</a>