thymrleaf简易页面

一枚java小学生,只是为了整理与分享,如有指点,欢迎联系

修改用户简单html

<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymrleaf.org">
<head>
    <meta charset="UTF-8">
    <title>update User</title>
</head>
<body>
<h1>this is update user</h1>
<form action="/updateUser"  method="post" th:object="${user}"><br>
    <label>uid:</label> <input type="text" name="uid" th:value="*{uid}" readonly><br>
    <label>username:</label> <input type="text" name="username" th:value="*{username}" required><br>
    <label>password:</label> <input type="password" name="password" th:value="*{password}" required><br>
    <label>age:</label> <input type="text" name="age" th:value="*{age}" required><br>
    <label>addr: </label><input type="text" name="addr" th:value="*{addr}" required><br>
    <input type="submit" value="submit">
</form>
</body>
</html>

user展示html

<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymrleaf.org">
<head>
    <meta charset="UTF-8">
    <title>user</title>
    <link rel="stylesheet"
          href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css"
          integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
          crossorigin="anonymous">
</head>
<body>
<h1>this is user page</h1>
<h2><a href="#" th:href="@{/addUserPage}">adduser</a></h2>
<table class="table table-hover" style="margin: 0 auto; width: 70%">
    <tr>
        <td>uid</td>
        <td>username</td>
        <td>password</td>
        <td>age</td>
        <td>addr</td>
        <td>manage</td>
    </tr>
    <tbody>
    <tr th:each="u:${users}">
        <td th:text="${u.uid}">0</td>
        <td th:text="${u.username}">0</td>
        <td th:text="${u.password}">0</td>
        <td th:text="${#numbers.formatDecimal(u.age,1,2)}">0</td>
        <td th:text="${u.addr}">0</td>
        <td><a href="#" th:href="@{'/deleteUserByUid/'+${u.uid}}">delete</a>&nbsp;<a href="#" th:href="@{'/Users/'+${u.uid}}">update</a></td>
    </tr>
    </tbody>
</table>
</body>
</html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值