前段。html

<!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>

相关推荐
inksci5 小时前
在线编辑表格,功能强大,json互转
前端·javascript·html
aloha_78913 小时前
HTML、JavaScript 与 TypeScript 基础速查
javascript·typescript·html
狮子座的男孩1 天前
html+css基础:25、3D变换(3D空间与景深/透视点的位置/位移/旋转/缩放/多重变换/背部可见性)
css·经验分享·html·旋转·透视点·缩放/位移·3d变换/空间与景深
anOnion1 天前
构建无障碍组件之Grid Pattern
前端·html·交互设计
xy34531 天前
Axure 9.0 内联框架加载方式
前端·ui·html·axure·原型·产品设计
奶酪博士2 天前
【1024快乐】用HTML写一个本地版心愿墙页面
html·1024程序员节
日常筹谋记2 天前
工业厂房 TPO 防水卷材:技术需求如何传导到配方层面?
运维·网络·html
BioRunYiXue2 天前
使用docker分析高通量测序数据
java·数据库·人工智能·spring cloud·docker·tomcat·html
进击的明明2 天前
前端开发中的 BEM 国际命名规范:让 CSS 不再"打架"
前端·css·html
烂蜻蜓3 天前
Pandas入门教程(十二):读取 HTML 表格——read_html 参数详解与网页数据清洗
python·html·pandas