作者主页:夜未央5788
简介:Java领域优质创作者、Java项目、学习资料、技术互助
文末获取源码
该项目分为前后台,分为管理员与普通用户两种角色,前台为普通用户登录,后台为管理员登录;
管理员角色包含以下功能:
管理员登录,修改个人密码,院系信息管理,注册用户管理,留言模块管理,报名信息管理等功能。
用户角色包含以下功能:
报名流程,考生须知,在线报名,用户注册,用户登录,留言板块等功能。
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可
4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;
5.数据库:MySql 5.7版本;
6.是否Maven项目:否;
1. 后端:mysql+Spring+hibernate+struts
2. 前端:JSP+CSS+JavaScript
1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;
若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行;
3. 将项目中WebRoot/WEB-INF/applicationContext.xml配置文件中的数据库配置改为自己的配置;
4. 运行项目,输入http://localhost:8080/baom 登录
注:Tomcat中配置路径必须为/baom,否则会有异常;
用户账号/密码:2014001/000000
管理员账号/密码:admin/admin
- public class baomingAction extends ActionSupport
- {
- private Integer id;
- private String dengji;
- private String kemu;
- private String xuehao;
-
- private String xingming;
- private String xingbie;
- private String nianling;
- private String dianhua;
-
- private String shenfenzheng;
- private Integer yuanxiId;
-
- private String del;
- private String message;
- private String path;
-
- private TBaomingDAO baomingDAO;
- private TYuanxiDAO yuanxiDAO;
-
-
- public String baomingAdd()
- {
- HttpServletRequest request=ServletActionContext.getRequest();
- HttpSession session=request.getSession();
- TUser user=(TUser)session.getAttribute("user");
-
- TBaoming baoming=new TBaoming();
-
- //baoming.setId(id);
- baoming.setDengji(dengji);
- baoming.setKemu(kemu);
- baoming.setXuehao(xuehao);
-
- baoming.setXingming(xingming);
- baoming.setXingbie(xingbie);
- baoming.setNianling(nianling);
- baoming.setDianhua(dianhua);
-
- baoming.setShenfenzheng(shenfenzheng);
- baoming.setYuanxiId(yuanxiId);
- baoming.setUserId(user.getId());
-
- baomingDAO.save(baoming);
-
-
- this.setMessage("信息添加成功");
- this.setPath("baomingMine.action");
- return "succeed";
-
- }
-
- public String baomingMine()
- {
- HttpServletRequest request=ServletActionContext.getRequest();
- HttpSession session=request.getSession();
- TUser user=(TUser)session.getAttribute("user");
-
- String sql = "from TBaoming where userId="+user.getId()+"order by dengji,kemu";
- List baomingList=baomingDAO.getHibernateTemplate().find(sql);
- for(int i=0;i<baomingList.size();i++)
- {
- TBaoming baoming=(TBaoming)baomingList.get(i);
- baoming.setYuanxi(yuanxiDAO.findById(baoming.getYuanxiId()));
- }
-
- request.setAttribute("baomingList", baomingList);
- return ActionSupport.SUCCESS;
- }
-
- public String baomingDelMe()
- {
- TBaoming baoming=baomingDAO.findById(id);
- baomingDAO.delete(baoming);
-
- this.setMessage("信息删除成功");
- this.setPath("baomingMine.action");
- return "succeed";
- }
-
-
- public String baomingMana2()//院系管理员
- {
- Map session=ActionContext.getContext().getSession();
- TYuanxi yuanxi=(TYuanxi)session.get("yuanxi");
-
- String sql = "from TBaoming where yuanxiId="+yuanxi.getId()+" order by dengji,kemu";
- List baomingList=baomingDAO.getHibernateTemplate().find(sql);
- for(int i=0;i<baomingList.size();i++)
- {
- TBaoming baoming=(TBaoming)baomingList.get(i);
- baoming.setYuanxi(yuanxiDAO.findById(baoming.getYuanxiId()));
- }
-
- HttpServletRequest request=ServletActionContext.getRequest();
- request.setAttribute("baomingList", baomingList);
- return ActionSupport.SUCCESS;
- }
-
- public String baomingMana0()//系统管理员
- {
- String sql = "from TBaoming order by dengji,kemu";
- List baomingList=baomingDAO.getHibernateTemplate().find(sql);
- for(int i=0;i<baomingList.size();i++)
- {
- TBaoming baoming=(TBaoming)baomingList.get(i);
- TYuanxi yuanxi = yuanxiDAO.findById(baoming.getYuanxiId());
- baoming.setYuanxi(yuanxi);
- }
-
- HttpServletRequest request=ServletActionContext.getRequest();
- request.setAttribute("baomingList", baomingList);
- return ActionSupport.SUCCESS;
- }
-
-
- public String baomingDel()
- {
- TBaoming baoming=baomingDAO.findById(id);
- baomingDAO.delete(baoming);
-
- HttpServletRequest request=ServletActionContext.getRequest();
- request.setAttribute("msg", "信息删除完毕");
- return "msg";
- }
-
-
- public Integer getId()
- {
- return id;
- }
-
- public void setId(Integer id)
- {
- this.id = id;
- }
-
- public String getDengji()
- {
- return dengji;
- }
-
- public void setDengji(String dengji)
- {
- this.dengji = dengji;
- }
-
- public String getKemu()
- {
- return kemu;
- }
-
- public void setKemu(String kemu)
- {
- this.kemu = kemu;
- }
-
- public String getXuehao()
- {
- return xuehao;
- }
-
- public void setXuehao(String xuehao)
- {
- this.xuehao = xuehao;
- }
-
- public String getXingming()
- {
- return xingming;
- }
-
- public void setXingming(String xingming)
- {
- this.xingming = xingming;
- }
-
- public String getXingbie()
- {
- return xingbie;
- }
-
- public void setXingbie(String xingbie)
- {
- this.xingbie = xingbie;
- }
-
- public String getNianling()
- {
- return nianling;
- }
-
- public void setNianling(String nianling)
- {
- this.nianling = nianling;
- }
-
- public String getDianhua()
- {
- return dianhua;
- }
-
- public void setDianhua(String dianhua)
- {
- this.dianhua = dianhua;
- }
-
- public String getShenfenzheng()
- {
- return shenfenzheng;
- }
-
- public void setShenfenzheng(String shenfenzheng)
- {
- this.shenfenzheng = shenfenzheng;
- }
-
- public Integer getYuanxiId()
- {
- return yuanxiId;
- }
-
- public void setYuanxiId(Integer yuanxiId)
- {
- this.yuanxiId = yuanxiId;
- }
-
- public String getDel()
- {
- return del;
- }
-
- public void setDel(String del)
- {
- this.del = del;
- }
-
- public String getMessage()
- {
- return message;
- }
-
- public void setMessage(String message)
- {
- this.message = message;
- }
-
- public String getPath()
- {
- return path;
- }
-
- public void setPath(String path)
- {
- this.path = path;
- }
-
-
- public TBaomingDAO getBaomingDAO()
- {
- return baomingDAO;
- }
-
- public void setBaomingDAO(TBaomingDAO baomingDAO)
- {
- this.baomingDAO = baomingDAO;
- }
-
- public TYuanxiDAO getYuanxiDAO()
- {
- return yuanxiDAO;
- }
-
- public void setYuanxiDAO(TYuanxiDAO yuanxiDAO)
- {
- this.yuanxiDAO = yuanxiDAO;
- }
-
-
- }
- public class liuyanAction extends ActionSupport
- {
- private Integer id;
- private String neirong;
- private String liuyanshi;
- private Integer stuId;
-
- private String huifu;
- private String huifushi;
-
- private TLiuyanDAO liuyanDAO;
-
- public String liuyanAdd()
- {
- HttpServletRequest request=ServletActionContext.getRequest();
- HttpSession session=request.getSession();
- TUser user=(TUser)session.getAttribute("user");
-
- TLiuyan liuyan=new TLiuyan();
-
- liuyan.setNeirong(neirong);
- liuyan.setLiuyanshi(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date()));
- liuyan.setUserId(user.getId());
-
- liuyan.setHuifu("");
- liuyan.setHuifushi("");
- liuyanDAO.save(liuyan);
-
- request.setAttribute("msg", "信息添加完毕");
- return "msg";
- }
-
- public String liuyanMana()
- {
- String sql="from TLiuyan order by liuyanshi";
- List liuyanList=liuyanDAO.getHibernateTemplate().find(sql);
-
- Map request=(Map)ServletActionContext.getContext().get("request");
- request.put("liuyanList", liuyanList);
- return ActionSupport.SUCCESS;
- }
-
- public String liuyanDel()
- {
- TLiuyan liuyan=liuyanDAO.findById(id);
- liuyanDAO.delete(liuyan);
-
- HttpServletRequest request=ServletActionContext.getRequest();
- request.setAttribute("msg", "信息删除完毕");
- return "msg";
- }
-
- public String liuyanHuifu()
- {
- TLiuyan liuyan=liuyanDAO.findById(id);
- liuyan.setHuifu(huifu);
- liuyan.setHuifushi(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date()));
-
- liuyanDAO.attachDirty(liuyan);
-
- HttpServletRequest request=ServletActionContext.getRequest();
- request.setAttribute("msg", "留言回复成功");
- return "msg";
- }
-
-
- public String liuyanDetail()
- {
- TLiuyan liuyan=liuyanDAO.findById(id);
- HttpServletRequest request=ServletActionContext.getRequest();
- request.setAttribute("liuyan", liuyan);
- return ActionSupport.SUCCESS;
- }
-
- public String liuyanAll()
- {
- String sql="from TLiuyan order by liuyanshi";
- List liuyanList=liuyanDAO.getHibernateTemplate().find(sql);
-
- Map request=(Map)ServletActionContext.getContext().get("request");
- request.put("liuyanList", liuyanList);
- return ActionSupport.SUCCESS;
- }
- public class UserAction extends ActionSupport
- {
- private Integer id;
- private Integer yuanxiId;
- private String xuehao;
- private String xingming;
-
- private String xingbie;
- private String nianling;
- private String dianhua;
- private String loginpw;
-
- private String del;
- private String message;
- private String path;
-
- private TUserDAO userDAO;
- private TYuanxiDAO yuanxiDAO;
-
-
- public String userReg()
- {
- Map request=(Map)ServletActionContext.getContext().get("request");
-
- String sql="from TUser where del='no' and xuehao='"+xuehao.trim()+"'";
- List list=userDAO.getHibernateTemplate().find(sql);
- if(list.size()>0)
- {
- this.setMessage("学号重复。请重新输入");
- this.setPath("qiantai/userinfo/userReg.jsp");
- return "succeed";
- }
- else
- {
- TUser user=new TUser();
-
- //user.setId(id);
- user.setYuanxiId(yuanxiId);
- user.setXuehao(xuehao);
- user.setXingming(xingming);
-
- user.setXingbie(xingbie);
- user.setNianling(nianling);
- user.setDianhua(dianhua);
- user.setLoginpw(loginpw);
-
- user.setDel("no");
-
- userDAO.save(user);
-
- this.setMessage("注册成功。请登录");
- this.setPath("qiantai/userinfo/userLogin.jsp");
- return "succeed";
- }
-
- }
-
- public String userMana()
- {
- String sql = "from TUser where del='no' order by yuanxiId";
- List userList=userDAO.getHibernateTemplate().find(sql);
- for(int i=0;i<userList.size();i++)
- {
- TUser user=(TUser)userList.get(i);
- user.setYuanxi(yuanxiDAO.findById(user.getYuanxiId()));
- }
-
- Map request=(Map)ServletActionContext.getContext().get("request");
- request.put("userList", userList);
- return ActionSupport.SUCCESS;
- }
-
- public String userDel()
- {
- TUser user=userDAO.findById(id);
- user.setDel("yes");
- userDAO.attachDirty(user);
-
- Map request=(Map)ServletActionContext.getContext().get("request");
- request.put("msg", "信息删除完毕");
- return "msg";
- }
如果也想学习本系统,下面领取。回复:121ssh