fix<优化下单逻辑>

master
liyansheng 2024-12-21 17:19:36 +08:00
parent 9dfe3a62aa
commit 7159a02ee2
3 changed files with 25 additions and 1 deletions

View File

@ -63,6 +63,7 @@ public class OrdersServlet extends HttpServlet {
} catch (Exception e) {
throw new RuntimeException(e);
}
resp.sendRedirect("/");
req.setAttribute("msg","下单成功");
req.getRequestDispatcher("/result.jsp").forward(req, resp);
}
}

View File

@ -9,6 +9,10 @@
</head>
<body>
<h1>我的订单</h1>
<div style="color: red;">
<p>${requestScope.msg}</p>
</div>
<table border="1">
<thead>
<tr>

View File

@ -0,0 +1,19 @@
<%@ 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">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>操作结果</title>
</head>
<body>
<h1>操作结果</h1>
<div style="color: red;">
<p>${requestScope.msg}</p>
</div>
<br>
<a href="/">主页</a>
</body>
</html>