• LIU[]
    了解作者
  • Java
    开发工具
  • 2MB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 0
    下载次数
  • 2021-03-18 18:12
    上传日期
该系统主要包含后台管理、界面操作两个模块。后天管理的主要功能是社员信息和活动信息的增加和删除;界面操作的主要功能是用户的登录和社团信息的查询。有管理员、注册用户、社团会员、社团成立申请表、活动信息表、社团信息等实体类。
Java_demo.rar
内容介绍
package servlet; import java.io.IOException; import java.io.PrintWriter; 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 factory.DaoFactory; import vo.Action; import vo.Addmassage; import vo.Department; import vo.User; /** * Servlet implementation class Operate */ @WebServlet("/Operate") public class Operate extends HttpServlet { private static final long serialVersionUID = 1L; /** * @see HttpServlet#HttpServlet() */ public Operate() { super(); // TODO Auto-generated constructor stub } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub /* * response.getWriter().append("Served at: ").append(request.getContextPath()); */ } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub doGet(request, response); response.setContentType("text/html;charset=utf-8"); //判断是不是添加社团事件 boolean isadmin ="create".equals(request.getParameter("create")) ; if(isadmin) { Department depart = new Department(); depart.setDepart_id(request.getParameter("Depart_id")); depart.setDepart_name(request.getParameter("Depart_name")); depart.setDepart_intro(request.getParameter("Depart_intro")); depart.setDepart_reason(request.getParameter("Depart_reason")); int result = DaoFactory.getDbUtilsDepartDaoImpl().doCreate(depart); if(result > 0) { PrintWriter writer = response.getWriter(); writer.print("社团创建成功!"); }else { response.sendRedirect("admin.jsp"); } } //判断是否是删除事件 boolean isadmin1 ="delete".equals(request.getParameter("delete")) ; if(isadmin1) { boolean result5; result5 =DaoFactory.getDbUtilsDepartDaoImpl().delete(request.getParameter("id")); response.sendRedirect("admin.jsp"); } //判断是否是修改操作 boolean isadmin2 ="update".equals(request.getParameter("update")) ; System.out.println(isadmin2); if(isadmin2) { String upId = request.getParameter("upId"); String upName = request.getParameter("upName"); String upIntro = request.getParameter("upIntro"); String upReason = request.getParameter("upReason"); String sourceId = request.getParameter("sourceId"); boolean result = DaoFactory.getDbUtilsDepartDaoImpl().update(upId, upName, upIntro, upReason, sourceId); System.out.println(result); response.sendRedirect("Suser.jsp"); } // 下面为社团活动的操作 boolean isadmin3 ="createAction".equals(request.getParameter("createAction")) ; System.out.println(request.getParameter("createAction")); if(isadmin3) { Action action = new Action(); action.setAction_id(request.getParameter("Action_id")); action.setAction_name(request.getParameter("Action_name")); action.setAction_content(request.getParameter("Action_content")); int result = DaoFactory.getDbUtilsActionDaoImpl().doCreate(action); if(result > 0) { PrintWriter writer = response.getWriter(); writer.print("社团活动添加成功!"); }else { response.sendRedirect("Suser.jsp"); } } boolean isadmin4 ="deleteAction".equals(request.getParameter("deleteAction")) ; System.out.println(request.getParameter("deleteAction")); if(isadmin4) { boolean result; result =DaoFactory.getDbUtilsActionDaoImpl().delete(request.getParameter("Actionid")); System.out.println(result); response.sendRedirect("Suser.jsp"); } //判断是不是修改活动操作 boolean isadmin5 ="updateAction".equals(request.getParameter("updateAction")) ; System.out.println(isadmin5); if(isadmin5) { String upActionId = request.getParameter("upActionId"); String upActionName = request.getParameter("upActionName"); String upActionContent = request.getParameter("upActionContent"); String sourceActionId = request.getParameter("sourceActionId"); boolean result1 = DaoFactory.getDbUtilsActionDaoImpl().update(upActionId, upActionName, upActionContent, sourceActionId); System.out.println(result1); response.sendRedirect("Suser.jsp"); } //判断是不是添加申请信息 boolean isadmin6 ="apply".equals(request.getParameter("apply")) ; System.out.println(request.getParameter("apply")); if(isadmin6) { Addmassage addmassage = new Addmassage(); addmassage.setJ_id(request.getParameter("J_id")); addmassage.setJ_name(request.getParameter("J_name")); addmassage.setJ_sex(request.getParameter("J_sex")); addmassage.setJ_age(request.getParameter("J_age")); addmassage.setJ_telephone(request.getParameter("J_telephone")); addmassage.setJ_address(request.getParameter("J_addresss")); addmassage.setJ_addDepart_id(request.getParameter("applyDepart_id")); int result = DaoFactory.getDbUtilsAddmassageDaoImpl().doCreate(addmassage); if(result > 0) { PrintWriter writer = response.getWriter(); writer.print("申请社团成功!"); }else { response.sendRedirect("index.jsp"); } } } }
评论
    相关推荐