<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>用户列表</title>
</head>
<body>
<h1>用户列表</h1>
<table>
<tr>
<th>ID</th>
<th>Name</th>
<th>Email</th>
<th>操作</th>
</tr>
<tr th:each="user : ${users}">
<td th:text="${user.id}"></td>
<td th:text="${user.name}"></td>
<td th:text="${user.email}"></td>
<td>
<a th:href="@{/user/{id}(id=${user.id})}">查看</a>
<a th:href="@{/user/edit/{id}(id=${user.id})
}">编辑</a>
<a th:href="@{/user/delete/{id}(id=${user.id})}">删除</a>
</td>
</tr>
</table>
<a th:href="@{/user/create}">新增</a>
</body>
</html>
111111111111111111111111111111111
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>查看用户</title>
</head>
<body>
<h1>用户信息</h1>
<p>ID: <span th:text="${user.id}"></span></p>
<p>Name: <span th:text="${user.name}"></span></p>
<p>Email: <span th:text="${user.email}"></span></p>
<a th:href="@{/}">返回</a>
</body>
</html>
22222222222222
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>创建用户</title>
</head>
<body>
<h1>创建用户</h1>
<form th:action="@{/user/create}" th:object="${user}" method="post">
<label for="name">Name:</label>
<input type="text" id="name" th:field="*{name}">
<br>
<label for="email">Email:</label>
<input type="text" id="email" th:field="*{email}">
<br>
<input type="submit" value="Create">
</form>
<a th:href="@{/}">Back</a>
</body>
</html>
333333333333333
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>编辑用户</title>
</head>
<body>
<h1>编辑用户</h1>
<form th:action="@{/user/edit/{id}(id={user.id})}" th:object="{user}" method="post">
<label for="name">Name:</label>
<input type="text" id="name" th:field="*{name}">
<br>
<label for="email">Email:</label>
<input type="text" id="email" th:field="*{email}">
<br>
<input type="submit" value="Update">
</form>
<a th:href="@{/}">返回</a>
</body>
</html>