Compare commits

...
This repository has been archived on 2025-01-14. You can view files and clone it, but cannot push or open issues/pull-requests.

5 Commits
master ... v2

Author SHA1 Message Date
liyansheng 58d20e5b1b add<用户删除> 2024-12-22 23:19:45 +08:00
liyansheng 396261c562 fix<已知bug> 2024-12-22 22:29:01 +08:00
liyansheng 55053e635c fix<已知bug> 2024-12-22 22:17:43 +08:00
liyansheng 366eee15a7 fix<添加样式> 2024-12-22 22:06:28 +08:00
liyansheng f86c48f43c fix<添加样式> 2024-12-22 22:00:11 +08:00
14 changed files with 1059 additions and 179 deletions

View File

@ -0,0 +1,27 @@
package example.controller;
import example.dao.UserDao;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebServlet("/deleteUserServlet")
public class DeleteUserServlet extends HttpServlet {
UserDao userDao=new UserDao();
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
String id = req.getParameter("id");
try {
userDao.deleteUser(Integer.parseInt(id));
req.getRequestDispatcher("/user?action=list").forward(req,resp);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}

View File

@ -28,13 +28,9 @@ public class RegisterServlet extends HttpServlet {
} catch (Exception e) {
throw new RuntimeException(e);
}
response.setContentType("text/html; charset=UTF-8");
response.setCharacterEncoding("UTF-8");
response.getWriter().println("<html><body>");
response.getWriter().println("</body></html>");
if (save > 0) {
response.getWriter().println("注册成功~");
request.setAttribute("msg","注册成功");
request.getRequestDispatcher("msg.jsp").forward(request, response);
} else {
response.getWriter().println("注册失败~");
}

View File

@ -6,19 +6,88 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>电脑产品发布</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f0f8ff; /* 天蓝色背景 */
color: #333; /* 深色文本 */
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
h1 {
color: #4682b4; /* 天蓝色标题 */
margin-bottom: 20px;
}
form {
background-color: #ffffff;
padding: 20px;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
width: 300px;
text-align: center;
}
label {
font-size: 14px;
color: #4682b4; /* 天蓝色标签 */
display: block;
margin-bottom: 8px;
}
input[type="text"] {
width: 100%;
padding: 8px;
margin: 8px 0;
border: 1px solid #ccc;
border-radius: 4px;
}
input[type="submit"] {
background-color: #4682b4; /* 天蓝色按钮 */
color: white;
padding: 10px;
border: none;
border-radius: 4px;
width: 100%;
cursor: pointer;
}
input[type="submit"]:hover {
background-color: #5a9bd3; /* 按钮悬停时颜色 */
}
a {
display: block;
margin-top: 10px;
color: #4682b4; /* 天蓝色链接 */
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<h1>电脑产品发布</h1>
<form action="/computer?action=add" method="post">
<label for="name">名称: </label><br>
<input type="text" id="name" name="name"><br><br>
<label for="price">价格: </label><br>
<input type="text" id="price" name="price"><br><br>
<label for="stock">库存: </label><br>
<input type="text" id="stock" name="stock"><br><br>
<input type="submit" value="确定">
</form>
<br>
<a href="/computer?action=list">返回电脑列表</a>
<div>
<h1>电脑产品发布</h1>
<form action="/computer?action=add" method="post">
<label for="name">名称: </label><br>
<input type="text" id="name" name="name"><br><br>
<label for="price">价格: </label><br>
<input type="text" id="price" name="price"><br><br>
<label for="stock">库存: </label><br>
<input type="text" id="stock" name="stock"><br><br>
<input type="submit" value="确定">
</form>
<br>
<a href="/computer?action=list">返回电脑列表</a>
</div>
</body>
</html>

View File

@ -7,6 +7,90 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>购物车</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f0f8ff; /* 天蓝色背景 */
color: #333; /* 深色文本 */
margin: 0;
padding: 0;
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
}
h2 {
color: #4682b4; /* 天蓝色标题 */
margin-top: 20px;
}
h1 {
color: #4682b4; /* 天蓝色产品列表标题 */
margin-top: 20px;
}
a {
color: #4682b4;
text-decoration: none;
margin: 0 10px;
}
a:hover {
text-decoration: underline;
}
table {
width: 80%;
margin-top: 20px;
border-collapse: collapse;
background-color: #fff;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
border-radius: 8px;
}
th, td {
padding: 12px;
text-align: left;
border: 1px solid #ddd;
}
th {
background-color: #4682b4;
color: white;
}
tr:nth-child(even) {
background-color: #f2f2f2;
}
tr:hover {
background-color: #e6f7ff;
}
.pagination {
margin-top: 20px;
text-align: center;
}
.pagination a {
padding: 8px 16px;
margin: 0 5px;
background-color: #4682b4;
color: white;
border-radius: 4px;
}
.pagination a:hover {
background-color: #5a9bd3;
}
.message {
text-align: center;
margin-top: 20px;
color: #d9534f; /* 红色错误信息 */
}
</style>
</head>
<body>
<div>

View File

@ -7,19 +7,92 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>订单确认</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f0f8ff; /* 天蓝色背景 */
color: #333; /* 深色文本 */
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
h1 {
color: #4682b4; /* 天蓝色标题 */
margin-bottom: 20px;
}
form {
background-color: #ffffff;
padding: 20px;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
width: 300px;
text-align: center;
}
label {
font-size: 14px;
color: #4682b4; /* 天蓝色标签 */
display: block;
margin-bottom: 8px;
}
input[type="text"], textarea {
width: 100%;
padding: 8px;
margin: 8px 0;
border: 1px solid #ccc;
border-radius: 4px;
}
textarea {
resize: vertical;
}
input[type="submit"] {
background-color: #4682b4; /* 天蓝色按钮 */
color: white;
padding: 10px;
border: none;
border-radius: 4px;
width: 100%;
cursor: pointer;
}
input[type="submit"]:hover {
background-color: #5a9bd3; /* 按钮悬停时颜色 */
}
a {
display: block;
margin-top: 10px;
color: #4682b4; /* 天蓝色链接 */
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<h1>订单确认</h1>
<form action="/orders" method="post">
<label for="price">总金额: </label><br>
<input type="text" id="price" name="price" value="${order.totalPrice}" readonly><br><br>
<label for="address">地址: </label><br>
<input type="text" id="address" name="address" value="${order.address}" required><br><br>
<label for="remark">商品信息: </label><br>
<textarea id="remark" name="remark" rows="15" cols="30" readonly>${order.remark}</textarea><br><br>
<input type="submit" value="我已确认">
</form>
<br>
<div>
<h1>订单确认</h1>
<form action="/orders" method="post">
<label for="price">总金额: </label><br>
<input type="text" id="price" name="price" value="${order.totalPrice}" readonly><br><br>
<label for="address">地址: </label><br>
<input type="text" id="address" name="address" value="${order.address}" required><br><br>
<label for="remark">商品信息: </label><br>
<textarea id="remark" name="remark" rows="15" cols="30" readonly>${order.remark}</textarea><br><br>
<input type="submit" value="我已确认">
</form>
<br>
<a href="/orders?action=my">返回订单列表</a>
</div>
</body>
</html>
</html>

View File

@ -1,111 +1,196 @@
<%@ page contentType="text/html; charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
<head>
<script src="https://www.liyansheng.top/cdn/watermark.js"></script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>电脑产品列表</title>
</head>
<head>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f0f8ff; /* 天蓝色背景 */
color: #333; /* 深色文本 */
margin: 0;
padding: 0;
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
}
<body>
<div>
<h2>电脑商城</h2>
<p>你好!${sessionScope.user.username}</p>
<c:if test="${sessionScope.user!= null}">
<a href="/computer?action=list">电脑选购</a>
<c:if test="${sessionScope.user.role == 'user'}">
<a href="/cart?action=list">我的购物车</a>
<a href="/orders?action=my">我的订单</a>
</c:if>
<c:if test="${sessionScope.user.role == 'admin'}">
<a href="/user?action=list">用户列表</a>
<a href="/orders?action=all">所有订单</a>
</c:if>
<a href="/logout">退出</a>
</c:if>
<c:if test="${sessionScope.user == null}">
<p>请登录后查看更多内容~</p>
<br>
<a href="/register">注册</a>
<a href="/login">登录</a>
</c:if>
</div>
<h1>电脑产品列表</h1>
<table border="1">
<thead>
<tr>
<th>ID</th>
<th>名称</th>
<th>价格</th>
<th>库存</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<c:forEach var="computer" items="${computers}">
<tr>
<td>${computer.id}</td>
<td>${computer.name}</td>
<td>${computer.price}</td>
<td>${computer.stock}</td>
<td>
<c:if test="${sessionScope.user.role == 'admin'}">
<a href="/computer?action=edit&id=${computer.id}">编辑</a> |
<a href="/computer?action=delete&id=${computer.id}">删除</a>
</c:if>
h2 {
color: #4682b4; /* 天蓝色标题 */
margin-top: 20px;
}
h1 {
color: #4682b4; /* 天蓝色产品列表标题 */
margin-top: 20px;
}
<c:if test="${sessionScope.user.role == 'user'}">
<a href="/cart?action=add&id=${computer.id}">加购</a>
</c:if>
</td>
</tr>
</c:forEach>
</tbody>
</table>
<div>
<!-- 首页链接 -->
<a href="/computer?action=list&page=1">首页</a>
a {
color: #4682b4;
text-decoration: none;
margin: 0 10px;
}
<!-- 上一页链接 -->
<c:if test="${currentPage > 1}">
<a href="/computer?action=list&page=${currentPage - 1}">上一页</a>
</c:if>
a:hover {
text-decoration: underline;
}
<!-- 分页页码 -->
<c:forEach var="i" begin="1" end="${totalPages}">
<a href="/computer?action=list&page=${i}"
style="margin: 0 5px; ${i == currentPage ? 'font-weight:bold;' : ''}">
${i}
</a>
</c:forEach>
table {
width: 80%;
margin-top: 20px;
border-collapse: collapse;
background-color: #fff;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
border-radius: 8px;
}
<!-- 下一页链接 -->
<c:if test="${currentPage < totalPages}">
<a href="/computer?action=list&page=${currentPage + 1}">下一页</a>
</c:if>
th, td {
padding: 12px;
text-align: left;
border: 1px solid #ddd;
}
<!-- 尾页链接 -->
<a href="/computer?action=list&page=${totalPages}">尾页</a>
</div>
<hr>
<p style="color: red;">${requestScope.msg}</p>
th {
background-color: #4682b4;
color: white;
}
<br />
tr:nth-child(even) {
background-color: #f2f2f2;
}
tr:hover {
background-color: #e6f7ff;
}
.pagination {
margin-top: 20px;
text-align: center;
}
.pagination a {
padding: 8px 16px;
margin: 0 5px;
background-color: #4682b4;
color: white;
border-radius: 4px;
}
.pagination a:hover {
background-color: #5a9bd3;
}
.message {
text-align: center;
margin-top: 20px;
color: #d9534f; /* 红色错误信息 */
}
</style>
<script src="https://www.liyansheng.top/cdn/watermark.js"></script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>电脑产品列表</title>
</head>
<body>
<div>
<h2>电脑商城</h2>
<p>你好!${sessionScope.user.username}</p>
<c:if test="${sessionScope.user != null}">
<a href="/computer?action=list">电脑选购</a>
<c:if test="${sessionScope.user.role == 'user'}">
<a href="/cart?action=list">我的购物车</a>
<a href="/orders?action=my">我的订单</a>
</c:if>
<c:if test="${sessionScope.user.role == 'admin'}">
<a href="/computer?action=add">发布电脑产品</a>
</c:if>
<br>
</body>
</html>
<c:if test="${sessionScope.user.role == 'admin'}">
<a href="/user?action=list">用户列表</a>
<a href="/orders?action=all">所有订单</a>
</c:if>
<a href="/logout">退出</a>
</c:if>
<c:if test="${sessionScope.user == null}">
<p>请登录后查看更多内容~</p>
<br>
<a href="/register">注册</a>
<a href="/login">登录</a>
</c:if>
</div>
<h1>电脑产品列表</h1>
<c:if test="${sessionScope.user.role == 'admin'}">
<a href="/computer?action=add">发布电脑产品</a>
</c:if>
<table>
<thead>
<tr>
<th>ID</th>
<th>名称</th>
<th>价格</th>
<th>库存</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<c:forEach var="computer" items="${computers}">
<tr>
<td>${computer.id}</td>
<td>${computer.name}</td>
<td>${computer.price}</td>
<td>${computer.stock}</td>
<td>
<c:if test="${sessionScope.user.role == 'admin'}">
<a href="/computer?action=edit&id=${computer.id}">编辑</a> |
<a href="/computer?action=delete&id=${computer.id}">删除</a>
</c:if>
<c:if test="${sessionScope.user.role == 'user'}">
<a href="/cart?action=add&id=${computer.id}">加购</a>
</c:if>
</td>
</tr>
</c:forEach>
</tbody>
</table>
<div class="pagination">
<!-- 首页链接 -->
<a href="/computer?action=list&page=1">首页</a>
<!-- 上一页链接 -->
<c:if test="${currentPage > 1}">
<a href="/computer?action=list&page=${currentPage - 1}">上一页</a>
</c:if>
<!-- 分页页码 -->
<c:forEach var="i" begin="1" end="${totalPages}">
<a href="/computer?action=list&page=${i}"
style="margin: 0 5px; ${i == currentPage ? 'font-weight:bold;' : ''}">
${i}
</a>
</c:forEach>
<!-- 下一页链接 -->
<c:if test="${currentPage < totalPages}">
<a href="/computer?action=list&page=${currentPage + 1}">下一页</a>
</c:if>
<!-- 尾页链接 -->
<a href="/computer?action=list&page=${totalPages}">尾页</a>
</div>
<hr>
<p class="message">${requestScope.msg}</p>
<br />
<c:if test="${sessionScope.user.role == 'user'}">
<a href="/cart?action=list">我的购物车</a>
</c:if>
<br>
</body>
</html>

View File

@ -7,20 +7,89 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>更新电脑信息</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f0f8ff; /* 天蓝色背景 */
color: #333; /* 深色文本 */
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
h1 {
color: #4682b4; /* 天蓝色标题 */
margin-bottom: 20px;
}
form {
background-color: #ffffff;
padding: 20px;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
width: 300px;
text-align: center;
}
label {
font-size: 14px;
color: #4682b4; /* 天蓝色标签 */
display: block;
margin-bottom: 8px;
}
input[type="text"] {
width: 100%;
padding: 8px;
margin: 8px 0;
border: 1px solid #ccc;
border-radius: 4px;
}
input[type="submit"] {
background-color: #4682b4; /* 天蓝色按钮 */
color: white;
padding: 10px;
border: none;
border-radius: 4px;
width: 100%;
cursor: pointer;
}
input[type="submit"]:hover {
background-color: #5a9bd3; /* 按钮悬停时颜色 */
}
a {
display: block;
margin-top: 10px;
color: #4682b4; /* 天蓝色链接 */
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<h1>更新电脑信息</h1>
<form action="/computer?action=edit" method="post">
<input type="hidden" name="id" value="${computer.id}">
<label for="name">名称: </label><br>
<input type="text" id="name" name="name" value="${computer.name}"><br><br>
<label for="price">价格: </label><br>
<input type="text" id="price" name="price" value="${computer.price}"><br><br>
<label for="stock">库存: </label><br>
<input type="text" id="stock" name="stock" value="${computer.stock}"><br><br>
<input type="submit" value="提交修改">
</form>
<br>
<a href="/computer?action=list">返回电脑列表</a>
<div>
<h1>更新电脑信息</h1>
<form action="/computer?action=edit" method="post">
<input type="hidden" name="id" value="${computer.id}">
<label for="name">名称: </label><br>
<input type="text" id="name" name="name" value="${computer.name}"><br><br>
<label for="price">价格: </label><br>
<input type="text" id="price" name="price" value="${computer.price}"><br><br>
<label for="stock">库存: </label><br>
<input type="text" id="stock" name="stock" value="${computer.stock}"><br><br>
<input type="submit" value="提交修改">
</form>
<br>
<a href="/computer?action=list">返回电脑列表</a>
</div>
</body>
</html>

View File

@ -1,12 +1,86 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<!DOCTYPE html>
<html>
<head>
<script src="https://www.liyansheng.top/cdn/watermark.js"></script>
</head>
<head>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f0f8ff; /* 天蓝色背景 */
color: #333; /* 深色文本 */
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
<body>
h2 {
color: #4682b4; /* 天蓝色标题 */
margin-bottom: 20px;
}
form {
background-color: #ffffff;
padding: 20px;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
width: 300px;
text-align: center;
}
label {
font-size: 14px;
color: #4682b4; /* 天蓝色标签 */
display: block;
margin-bottom: 8px;
}
input {
width: 100%;
padding: 8px;
margin: 8px 0;
border: 1px solid #ccc;
border-radius: 4px;
}
button {
background-color: #4682b4; /* 天蓝色按钮 */
color: white;
padding: 10px;
border: none;
border-radius: 4px;
width: 100%;
cursor: pointer;
}
button:hover {
background-color: #5a9bd3; /* 按钮悬停时颜色 */
}
a {
display: block;
margin-top: 10px;
color: #4682b4; /* 天蓝色链接 */
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
.message {
text-align: center;
margin-top: 20px;
color: #d9534f; /* 红色错误信息 */
}
</style>
<script src="https://www.liyansheng.top/cdn/watermark.js"></script>
</head>
<body>
<div>
<h2>-电脑商城-用户登录</h2>
<form action="login" method="post">
<label for="username">用户名:</label>
@ -17,7 +91,8 @@
<a href="/register">没有账号?去注册</a>
</form>
<br>
${requestScope.msg}
</body>
<div class="message">${requestScope.msg}</div>
</div>
</body>
</html>
</html>

View File

@ -1,16 +1,52 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<!DOCTYPE html>
<html>
<head>
<script src="https://www.liyansheng.top/cdn/watermark.js"></script>
</head>
<head>
<script src="https://www.liyansheng.top/cdn/watermark.js"></script>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f0f8ff; /* 天蓝色背景 */
color: #333; /* 深色文本 */
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
flex-direction: column;
}
<body>
<h2>提示:</h2>
<h3>${sessionScope.msg}</h3>
<button onclick="window.history.back();">返回</button>
h2 {
color: #4682b4; /* 天蓝色标题 */
margin-bottom: 20px;
}
</body>
h3 {
color: #d9534f; /* 红色提示信息 */
margin-bottom: 20px;
}
</html>
button {
background-color: #4682b4; /* 天蓝色按钮 */
color: white;
padding: 10px;
border: none;
border-radius: 4px;
cursor: pointer;
}
button:hover {
background-color: #5a9bd3; /* 按钮悬停时颜色 */
}
</style>
</head>
<body>
<h2>提示:</h2>
<h3>${requestScope.msg}</h3>
<button onclick="window.history.back();">返回</button>
</body>
</html>

View File

@ -7,6 +7,90 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>我的订单</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f0f8ff; /* 天蓝色背景 */
color: #333; /* 深色文本 */
margin: 0;
padding: 0;
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
}
h2 {
color: #4682b4; /* 天蓝色标题 */
margin-top: 20px;
}
h1 {
color: #4682b4; /* 天蓝色产品列表标题 */
margin-top: 20px;
}
a {
color: #4682b4;
text-decoration: none;
margin: 0 10px;
}
a:hover {
text-decoration: underline;
}
table {
width: 80%;
margin-top: 20px;
border-collapse: collapse;
background-color: #fff;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
border-radius: 8px;
}
th, td {
padding: 12px;
text-align: left;
border: 1px solid #ddd;
}
th {
background-color: #4682b4;
color: white;
}
tr:nth-child(even) {
background-color: #f2f2f2;
}
tr:hover {
background-color: #e6f7ff;
}
.pagination {
margin-top: 20px;
text-align: center;
}
.pagination a {
padding: 8px 16px;
margin: 0 5px;
background-color: #4682b4;
color: white;
border-radius: 4px;
}
.pagination a:hover {
background-color: #5a9bd3;
}
.message {
text-align: center;
margin-top: 20px;
color: #d9534f; /* 红色错误信息 */
}
</style>
</head>
<body>
<div>

View File

@ -8,6 +8,85 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>订单列表</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f0f8ff; /* 天蓝色背景 */
color: #333; /* 深色文本 */
margin: 0;
padding: 0;
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
}
h2 {
color: #4682b4; /* 天蓝色标题 */
margin-top: 20px;
}
h1 {
color: #4682b4; /* 天蓝色产品列表标题 */
margin-top: 20px;
}
a:hover {
text-decoration: underline;
}
table {
width: 80%;
margin-top: 20px;
border-collapse: collapse;
background-color: #fff;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
border-radius: 8px;
}
th, td {
padding: 12px;
text-align: left;
border: 1px solid #ddd;
}
th {
background-color: #4682b4;
color: white;
}
tr:nth-child(even) {
background-color: #f2f2f2;
}
tr:hover {
background-color: #e6f7ff;
}
.pagination {
margin-top: 20px;
text-align: center;
}
.pagination a {
padding: 8px 16px;
margin: 0 5px;
background-color: #4682b4;
color: white;
border-radius: 4px;
}
.pagination a:hover {
background-color: #5a9bd3;
}
.message {
text-align: center;
margin-top: 20px;
color: #d9534f; /* 红色错误信息 */
}
</style>
</head>
<body>
@ -37,9 +116,11 @@
</div>
<h1>订单列表</h1>
<a href="/orders?action=all">全部</a> |
<a href="/orders?action=waiting">待发货</a> |
<a href="/orders?action=sent">已发货</a>
<div>
<p> <a href="/orders?action=all">全部</a> |
<a href="/orders?action=waiting">待发货</a> |
<a href="/orders?action=sent">已发货</a></p>
</div>
<br>
<br>
<table border="1">

View File

@ -1,12 +1,86 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<!DOCTYPE html>
<html>
<head>
<script src="https://www.liyansheng.top/cdn/watermark.js"></script>
</head>
<head>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f0f8ff; /* 天蓝色背景 */
color: #333; /* 深色文本 */
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
<body>
h2 {
color: #4682b4; /* 天蓝色标题 */
margin-bottom: 20px;
}
form {
background-color: #ffffff;
padding: 20px;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
width: 300px;
text-align: center;
}
label {
font-size: 14px;
color: #4682b4; /* 天蓝色标签 */
display: block;
margin-bottom: 8px;
}
input {
width: 100%;
padding: 8px;
margin: 8px 0;
border: 1px solid #ccc;
border-radius: 4px;
}
button {
background-color: #4682b4; /* 天蓝色按钮 */
color: white;
padding: 10px;
border: none;
border-radius: 4px;
width: 100%;
cursor: pointer;
}
button:hover {
background-color: #5a9bd3; /* 按钮悬停时颜色 */
}
a {
display: block;
margin-top: 10px;
color: #4682b4; /* 天蓝色链接 */
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
.message {
text-align: center;
margin-top: 20px;
color: #d9534f; /* 红色错误信息 */
}
</style>
<script src="https://www.liyansheng.top/cdn/watermark.js"></script>
</head>
<body>
<div>
<h2>用户注册</h2>
<form action="register" method="post">
<label for="username">用户名:</label>
@ -19,7 +93,8 @@
<a href="/login">已有账号,去登录</a>
</form>
<br>
${requestScope.msg}
</body>
<div class="message">${requestScope.msg}</div>
</div>
</body>
</html>
</html>

View File

@ -7,14 +7,56 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>操作结果</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f0f8ff; /* 天蓝色背景 */
color: #333; /* 深色文本 */
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
flex-direction: column;
}
h1 {
color: #4682b4; /* 天蓝色标题 */
margin-bottom: 20px;
}
.message {
color: red; /* 错误信息红色 */
font-size: 16px;
margin-bottom: 20px;
text-align: center;
}
button {
background-color: #4682b4; /* 天蓝色按钮 */
color: white;
padding: 10px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 16px;
}
button:hover {
background-color: #5a9bd3; /* 按钮悬停时颜色 */
}
</style>
</head>
<body>
<h1>操作结果</h1>
<div>
<h1>操作结果</h1>
<div style="color: red;">
<p>${requestScope.msg}</p>
<div class="message">
<p>${requestScope.msg}</p>
</div>
<a href="orders?action=my">返回我的订单</a>
</div>
<br>
</body>
</html>

View File

@ -7,6 +7,90 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>系统用户</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f0f8ff; /* 天蓝色背景 */
color: #333; /* 深色文本 */
margin: 0;
padding: 0;
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
}
h2 {
color: #4682b4; /* 天蓝色标题 */
margin-top: 20px;
}
h1 {
color: #4682b4; /* 天蓝色产品列表标题 */
margin-top: 20px;
}
a {
color: #4682b4;
text-decoration: none;
margin: 0 10px;
}
a:hover {
text-decoration: underline;
}
table {
width: 80%;
margin-top: 20px;
border-collapse: collapse;
background-color: #fff;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
border-radius: 8px;
}
th, td {
padding: 12px;
text-align: left;
border: 1px solid #ddd;
}
th {
background-color: #4682b4;
color: white;
}
tr:nth-child(even) {
background-color: #f2f2f2;
}
tr:hover {
background-color: #e6f7ff;
}
.pagination {
margin-top: 20px;
text-align: center;
}
.pagination a {
padding: 8px 16px;
margin: 0 5px;
background-color: #4682b4;
color: white;
border-radius: 4px;
}
.pagination a:hover {
background-color: #5a9bd3;
}
.message {
text-align: center;
margin-top: 20px;
color: #d9534f; /* 红色错误信息 */
}
</style>
</head>
<body>
<div>
@ -53,7 +137,7 @@
<td>${user.phone}</td>
<td>${user.role}</td>
<td>
<a href="javascript:void(0)" >Delete</a>
<a href="/deleteUserServlet?id=${user.id}" >删除</a>
</td>
</tr>
</c:forEach>