From 4ffbdd3585359905a875b76aa0e039a6726f93b5 Mon Sep 17 00:00:00 2001 From: IE-WEB <1472343820@qq.com> Date: Fri, 6 Dec 2024 00:00:36 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E6=96=B0=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- userDetail.jsp | 282 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 195 insertions(+), 87 deletions(-) diff --git a/userDetail.jsp b/userDetail.jsp index b21e2f0..153285c 100644 --- a/userDetail.jsp +++ b/userDetail.jsp @@ -1,91 +1,199 @@ -<%@ page language="java" pageEncoding="UTF-8"%> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> -<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> -<%@ page isELIgnored="false" %> +package com.itbaizhan.action; -<% -String path = request.getContextPath(); // 获取当前Web应用的根路径 -%> +import java.io.IOException; +import java.sql.ResultSet; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; - - - - - - - - +import javax.servlet.RequestDispatcher; +import javax.servlet.ServletConfig; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; - - - - - - - - +import com.itbaizhan.dao.DB; +import com.itbaizhan.orm.Tuser; +import com.itbaizhan.service.liuService; - - - - - - - - - - - - - - - - - - - - - - - -
  
序号 账号 密 码 姓名 操作
- ${ss.index+1} - - ${user.loginname} - - ${user.loginpw} - - ${user.name} - - - -
- - - - -     - -
- - - - - - - - - - -
属性:${xinyong.shuxing}
评价内容:${xinyong.neirong}
评价时间:${xinyong.shijian}
-
-
-
- - +public class user_servlet extends HttpServlet +{ + public void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException + { + String type = req.getParameter("type"); + + if(type.endsWith("userReg")) + { + userReg(req, res); + } + if(type.endsWith("userLogout")) + { + userLogout(req, res); + } + if(type.endsWith("userMana")) + { + userMana(req, res); + } + if(type.endsWith("userDel")) + { + userDel(req, res); + } + + if(type.endsWith("userDetail")) + { + userDetail(req, res); + } + } + + public void userReg(HttpServletRequest req, HttpServletResponse res) + { + String id = String.valueOf(new Date().getTime()); + String loginname = req.getParameter("loginname"); + String loginpw = req.getParameter("loginpw"); + String name = req.getParameter("name"); + String del = "no"; + + String s = liuService.panduan_zhanghao(loginname); + if(s.equals("yizhan")) + { + req.setAttribute("message", "账号已占用,请重新选择账号"); + req.setAttribute("path", "site/userreg/userreg.jsp"); + String targetURL = "/common/success.jsp"; + dispatch(targetURL, req, res); + } + else + { + String sql = "insert into t_user values(?,?,?,?,?)"; + Object[] params = {id, loginname, loginpw, name, del}; + DB mydb = new DB(); + mydb.doPstm(sql, params); + mydb.closed(); + + req.setAttribute("message", "注册成功,请登录"); + req.setAttribute("path", "site/default.jsp"); + String targetURL = "/common/success.jsp"; + dispatch(targetURL, req, res); + } + } + + public void userLogout(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException + { + HttpSession session = req.getSession(); + session.setAttribute("userType", null); + session.setAttribute("user", null); + + req.setAttribute("message", "成功退出系统"); + req.setAttribute("path", "site/default.jsp"); + String targetURL = "/common/success.jsp"; + dispatch(targetURL, req, res); + } + + public void userMana(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException + { + List userList = new ArrayList(); + String sql = "select * from t_user where del='no'"; + Object[] params = {}; + DB mydb = new DB(); + try + { + mydb.doPstm(sql, params); + ResultSet rs = mydb.getRs(); + while(rs.next()) + { + Tuser user = new Tuser(); + user.setId(rs.getString("id")); + user.setLoginname(rs.getString("loginname")); + user.setLoginpw(rs.getString("loginpw")); + user.setLoginpw(rs.getString("loginpw")); + user.setName(rs.getString("name")); + userList.add(user); + } + rs.close(); + } + catch(Exception e) + { + e.printStackTrace(); + } + mydb.closed(); + + req.setAttribute("userList", userList); + req.getRequestDispatcher("admin/user/userMana.jsp").forward(req, res); + } + + public void userDel(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException + { + String id = req.getParameter("id"); + String sql = "update t_user set del='yes' where id=?"; + Object[] params = {id}; + DB mydb = new DB(); + mydb.doPstm(sql, params); + mydb.closed(); + + req.setAttribute("msg", "用户信息删除成功"); + String targetURL = "/common/msg.jsp"; + dispatch(targetURL, req, res); + } + + public void userDetail(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException + { + String id = req.getParameter("id"); + + List userList = new ArrayList(); + String sql = "select * from t_user where id=?"; + Object[] params = {id}; + DB mydb = new DB(); + try + { + mydb.doPstm(sql, params); + ResultSet rs = mydb.getRs(); + while(rs.next()) + { + Tuser user = new Tuser(); + user.setId(rs.getString("id")); + user.setLoginname(rs.getString("loginname")); + user.setLoginpw(rs.getString("loginpw")); + user.setLoginpw(rs.getString("loginpw")); + user.setName(rs.getString("name")); + userList.add(user); + } + rs.close(); + } + catch(Exception e) + { + e.printStackTrace(); + } + mydb.closed(); + + req.setAttribute("userList", userList); + req.setAttribute("xinyongList", liuService.getxinyongList(id)); + req.getRequestDispatcher("admin/user/userDetail.jsp").forward(req, res); + } + + public void dispatch(String targetURI, HttpServletRequest request, HttpServletResponse response) + { + RequestDispatcher dispatch = getServletContext().getRequestDispatcher(targetURI); + try + { + dispatch.forward(request, response); + } + catch (ServletException e) + { + e.printStackTrace(); + } + catch (IOException e) + { + e.printStackTrace(); + } + } + + public void init(ServletConfig config) throws ServletException + { + super.init(config); + } + + public void destroy() + { + } +} From 8e4dc9a41681e84e9e12e966cea31b0f2b44e980 Mon Sep 17 00:00:00 2001 From: IE-WEB <1472343820@qq.com> Date: Fri, 6 Dec 2024 00:04:43 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- userMana.jsp | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/userMana.jsp b/userMana.jsp index 3a0e09a..45f8de5 100644 --- a/userMana.jsp +++ b/userMana.jsp @@ -3,7 +3,7 @@ <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> <%@ page isELIgnored="false" %> <% -String path = request.getContextPath(); +String path = request.getContextPath(); // 获取应用的上下文路径 %> @@ -15,16 +15,21 @@ String path = request.getContextPath(); + + + @@ -36,28 +41,32 @@ String path = request.getContextPath();    - 序号 - 账号 - 密 码 - 姓名 - 操作 + 序号 + 账号 + 密 码 + 姓名 + 操作 - - + + + - ${ss.index+1} + ${ss.index+1} - ${user.loginname} + ${user.loginname} - ${user.loginpw} + ${user.loginpw} - ${user.name} + ${user.name} - + + From 4160c016723c3eea35634965b36ced2394c8f2b5 Mon Sep 17 00:00:00 2001 From: IE-WEB <1472343820@qq.com> Date: Fri, 6 Dec 2024 11:17:10 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=96=B0=E7=9A=84?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xinyongAdd.jsp | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 xinyongAdd.jsp diff --git a/xinyongAdd.jsp b/xinyongAdd.jsp new file mode 100644 index 0000000..499b7b6 --- /dev/null +++ b/xinyongAdd.jsp @@ -0,0 +1,83 @@ +<%@page import="java.text.SimpleDateFormat"%> +<%@page import="java.util.Date"%> +<%@ page language="java" pageEncoding="UTF-8"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> +<%@ page isELIgnored="false"%> + +<% +String path = request.getContextPath(); +%> + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
  
+ 评价属性: + + 好评 +      + 差评 +
+ 评价内容: + + +
+ 评价时间: + + "/> + +
+   + + "/> +   +   +
+
+ + From c662820f59562d12d408fad4d6868074c2b7debb Mon Sep 17 00:00:00 2001 From: IE-WEB <1472343820@qq.com> Date: Fri, 6 Dec 2024 11:20:12 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E6=96=B0=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test | 1 + 1 file changed, 1 insertion(+) create mode 160000 test diff --git a/test b/test new file mode 160000 index 0000000..7ef20de --- /dev/null +++ b/test @@ -0,0 +1 @@ +Subproject commit 7ef20de6fbfb1a60e420462747344546a2e84615 From 924e1b297cfac0c0bc1e97822982ef11ee96ef3a Mon Sep 17 00:00:00 2001 From: IE-WEB <1472343820@qq.com> Date: Fri, 6 Dec 2024 11:26:20 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xinyongAdd.jsp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/xinyongAdd.jsp b/xinyongAdd.jsp index 499b7b6..a534854 100644 --- a/xinyongAdd.jsp +++ b/xinyongAdd.jsp @@ -10,7 +10,7 @@ String path = request.getContextPath(); %> - + @@ -21,7 +21,7 @@ String path = request.getContextPath(); - -
+ + @@ -64,7 +64,7 @@ String path = request.getContextPath(); @@ -72,8 +72,7 @@ String path = request.getContextPath();   From 58866100ec100f629134bb11fea0aa67424f40cb Mon Sep 17 00:00:00 2001 From: IE-WEB <1472343820@qq.com> Date: Fri, 6 Dec 2024 11:31:17 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xinyongAdd.jsp | 53 ++++++++++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/xinyongAdd.jsp b/xinyongAdd.jsp index a534854..887d778 100644 --- a/xinyongAdd.jsp +++ b/xinyongAdd.jsp @@ -1,79 +1,86 @@ -<%@page import="java.text.SimpleDateFormat"%> -<%@page import="java.util.Date"%> -<%@ page language="java" pageEncoding="UTF-8"%> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> -<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> -<%@ page isELIgnored="false"%> +<%@page import="java.text.SimpleDateFormat"%> +<%@page import="java.util.Date"%> +<%@ page language="java" pageEncoding="UTF-8"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> +<%@ page isELIgnored="false"%> <% -String path = request.getContextPath(); +String path = request.getContextPath(); // 获取应用的上下文路径 %> - - - - - - - + + + + + + + + + - - + +
   "/> - +
- "/> -   + "/>  
+ + + +
  
评价属性: + 好评      差评
评价内容: - +
评价时间: - "/> - + "/>
  - "/> -   + "/> +  
From 3959f3baf64767a4b05592993d53213f557c10a7 Mon Sep 17 00:00:00 2001 From: wyc <3487474859@qq.com> Date: Thu, 12 Dec 2024 10:49:48 +0800 Subject: [PATCH 7/7] 2 --- sysPro.jsp | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 sysPro.jsp diff --git a/sysPro.jsp b/sysPro.jsp new file mode 100644 index 0000000..e69de29