체육관 관리 시스템 소스 코드
- package com.gym.user.action;
-
- import java.io.IOException;
- import java.io.PrintWriter;
- import java.util.ArrayList;
- import java.util.List;
-
- import javax.servlet.RequestDispatcher;
- import javax.servlet.ServletException;
- import javax.servlet.http.HttpServlet;
- import javax.servlet.http.HttpServletRequest;
- import javax.servlet.http.HttpServletResponse;
-
- import com.gym.model.UserModel;
- import com.gym.user.service.impl.UserServiceImpl;
- import com.gym.utils.CheckOnline;
- import com.gym.utils.Constant;
- import com.gym.utils.Md5;
-
- public class UserAction extends HttpServlet {
-
- /**
- * The doGet method of the servlet. <br>
- *
- * This method is called when a form has its tag value method equals to get.
- *
- * @param request
- * the request send by the client to the server
- * @param response
- * the response send by the server to the client
- * @throws ServletException
- * if an error occurred
- * @throws IOException
- * if an error occurred
- */
- public void doGet(HttpServletRequest request, HttpServletResponse response)
- throws ServletException, IOException {
-
- request.setCharacterEncoding("utf-8");
-
- String action = request.getParameter("action");
-
- //
- if (!CheckOnline.isUserOnline(request)) {
- response.sendRedirect("../login.html");// ,
- return;
- }
-
- String userId = request.getSession().getAttribute("uId").toString();
-
- UserServiceImpl userServiceImpl = new UserServiceImpl();
-
- if (action == null) { //
-
- UserModel userModel = userServiceImpl.queryUserInfoById(userId);
- List userList = new ArrayList();
- userList.add(userModel);
-
- RequestDispatcher dispatcher = request
- .getRequestDispatcher("/usercenter/index.jsp");
- request.setAttribute("userList", userList);
- dispatcher.forward(request, response);
- } else if (action.equals("alterinfo")) { //
-
- UserModel userModel = userServiceImpl.queryUserInfoById(userId);
- List userList = new ArrayList();
- userList.add(userModel);
-
- RequestDispatcher dispatcher = request
- .getRequestDispatcher("/usercenter/alterinfo.jsp");
- request.setAttribute("userList", userList);
- dispatcher.forward(request, response);
-
- } else if (action.equals("resetpwd")) { //
-
- RequestDispatcher dispatcher = request
- .getRequestDispatcher("/usercenter/resetpwd.jsp");
-
- dispatcher.forward(request, response);
-
- } else if (action.equals("mybook")) {
-
- UserModel userModel = new UserModel();
- userModel.setuId((String) request.getSession().getAttribute("uId"));
-
- List myGroundBookList = userServiceImpl.queryMyBook(userModel);
-
- RequestDispatcher dispatcher = request
- .getRequestDispatcher("/usercenter/mybook.jsp");
- request.setAttribute("myGroundBookList", myGroundBookList);
- dispatcher.forward(request, response);
-
- } else if (action.equals("myrent")) {
-
- UserModel userModel = new UserModel();
- userModel.setuId((String) request.getSession().getAttribute("uId"));
-
- List myEquipmentRentList = userServiceImpl.queryMyRent(userModel);
-
- RequestDispatcher dispatcher = request
- .getRequestDispatcher("/usercenter/myrent.jsp");
- request.setAttribute("myEquipmentRentList", myEquipmentRentList);
- dispatcher.forward(request, response);
-
- } else {
-
- RequestDispatcher dispatcher = request
- .getRequestDispatcher("/error.jsp");
-
- dispatcher.forward(request, response);
-
- }
-
- }
-
- /**
- * The doPost method of the servlet. <br>
- *
- * This method is called when a form has its tag value method equals to
- * post.
- *
- * @param request
- * the request send by the client to the server
- * @param response
- * the response send by the server to the client
- * @throws ServletException
- * if an error occurred
- * @throws IOException
- * if an error occurred
- */
- public void doPost(HttpServletRequest request, HttpServletResponse response)
- throws ServletException, IOException {
- request.setCharacterEncoding("utf-8");
-
- String action = request.getParameter("action");
-
- //
- if (!CheckOnline.isUserOnline(request)) {
- response.sendRedirect("../login.html");
- return;
- }
-
- String userId = request.getSession().getAttribute("uId").toString();
-
- UserServiceImpl userServiceImpl = new UserServiceImpl();
- UserModel userModel = new UserModel();
-
- if (action == null) {
-
- } else if (action.equals("alter")) { //
-
- userModel.setuId(userId);
- userModel.setuEmail(request.getParameter("email"));
- userModel.setuIdCard(request.getParameter("idcard"));
- userModel.setuPhone(request.getParameter("phone"));
- userModel.setuName(request.getParameter("name"));
-
- switch (userServiceImpl.alterUserInfo(userModel)) {
- case Constant.SUCCESS:
- request.getSession()
- .setAttribute("uName", userModel.getuName()); // session
-
- response.sendRedirect("../success.jsp");
- break;
-
- case Constant.ERROR:
- response.sendRedirect("../error.jsp?errorCode="
- + Constant.ERROR);
- break;
-
- default:
- break;
- }
-
- } else if (action.equals("resetpwd")) { //
-
- userModel.setuId(userId);
- String oldPwd = request.getParameter("oldpwd");
- String newPwd1 = request.getParameter("newpwd1");
- String newPwd2 = request.getParameter("newpwd2");
-
- switch (userServiceImpl.alterUserPwd(userModel, oldPwd, newPwd1,
- newPwd2)) {
- case Constant.SUCCESS:
- request.getSession()
- .setAttribute("uName", userModel.getuName()); // session
- request.getSession().setAttribute("uId", userModel.getuId()); // session
-
- response.sendRedirect("../success.jsp");
- break;
-
- case Constant.ERROR:
- response.sendRedirect("../error.jsp?errorCode="
- + Constant.ERROR);
- break;
-
- case Constant.USERPWDERROR:
- response.sendRedirect("../error.jsp?errorCode="
- + Constant.USERPWDERROR);
- break;
-
- case Constant.PASSWORDDIFFER:
- response.sendRedirect("../error.jsp?errorCode="
- + Constant.PASSWORDDIFFER);
- break;
-
- default:
- break;
- }
-
- }
-
- }
- }
광동해양대학 체육관 관리 시스템 소스 코드 - jsp 코드 라이브러리 - 클라우드 코드http://yuncode.net/code/c_511527388c75a79
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
체육관 관리 시스템 소스 코드부분 코드: 광동해양대학 체육관 관리 시스템 소스 코드 - jsp 코드 라이브러리 - 클라우드 코드http://yuncode.net/code/c_511527388c75a79...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.