作者主页:夜未央5788
简介:Java领域优质创作者、Java项目、学习资料、技术互助
文末获取源码
本项目分为前后台,主要有管理员、学生、老师三种角色;
主要实现以下功能:
(1) 管理员登录:需要管理员的账号密码登录,登录之后拥有管理员权限,可以管理学生老师信息、资料信息、公告发布、留言增删、科研动态管理、教研成果管理、优秀课例管理。
(2) 学生老师可以登录,密码修改,在页面可以进行关键字搜索资料文件,可以留言评论(无回复)
(3) 功能模块: 教师风采、教学管理模块(教师风采,资料下载),科研管理模块
(科研动态,教研成果,优秀课例)【这三个新闻模式】)
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. 后端:Spring Struts Hibernate
2. 前端:JSP+css+javascript+jQuery
1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;
若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行;
3. 将项目中jdbc.properties配置文件中的数据库配置改为自己的配置;
4. 运行项目,输入http://localhost:8080/bankPro 登录
管理员用户密码:admin/111111
学生用户密码:zs/222222
老师用户密码:gg/123456

后台界面
CgAction
- package com.my.pro.action;
-
- import java.util.HashMap;
- import org.springframework.beans.BeanUtils;
- import java.util.Map;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Controller;
- import org.springframework.web.bind.annotation.RequestMapping;
- import java.io.File;
- import java.util.ArrayList;
- import java.util.HashMap;
- import java.util.List;
- import java.util.Map;
- import javax.servlet.http.HttpSession;
- import org.apache.struts2.ServletActionContext;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.context.annotation.Scope;
- import org.springframework.stereotype.Controller;
- import com.opensymphony.xwork2.ActionContext;
- import com.opensymphony.xwork2.ActionSupport;
- import com.my.pro.utils.Pager;
- import com.opensymphony.xwork2.ModelDriven;
- import java.util.*;
-
- import com.my.pro.model.*;
- import com.my.pro.dao.*;
- import com.my.pro.service.*;
-
- /**
- * @ClassName:
- * @Description:
- * @author administrator
- *
- */
-
- @Controller("cgAction")
- @Scope("prototype")
- public class CgAction extends BaseAction implements ModelDriven
{ -
- private static final long serialVersionUID = 1L;
-
-
-
- //==========model==============
- private Cg cg;
- @Override
- public Cg getModel() {
- if(cg==null) cg = new Cg();
- return cg;
- }
- //==========model==============
- /**
- * 依赖注入 start dao/service/===
- */
- @Autowired
- private CgService cgService;
-
- //依赖注入 end dao/service/===
-
- //-------------------------华丽分割线---------------------------------------------
-
- //============自定义参数start=============
-
- //============自定义参数end=============
-
-
- //-------------------------华丽分割线---------------------------------------------
-
- //============文件上传start=======================================================
-
-
- private File file;
- //提交过来的file的名字
- private String fileFileName;
- //提交过来的file的MIME类型
- private String fileContentType;
- public File getFile() {
- return file;
- }
- public void setFile(File file) {
- this.file = file;
- }
- public String getFileFileName() {
- return fileFileName;
- }
- public void setFileFileName(String fileFileName) {
- this.fileFileName = fileFileName;
- }
- public String getFileContentType() {
- return fileContentType;
- }
- public void setFileContentType(String fileContentType) {
- this.fileContentType = fileContentType;
- }
- //============文件上传end=========================================================
- public String jsonAction() {
- // dataMap中的数据将会被Struts2转换成JSON字符串,所以这里要先清空其中的数据
- jsonMap.clear();
- jsonMap.put("success", true);
- return JSON_TYPE;
- }
- //-------------------------华丽分割线---------------------------------------------//
-
- //=============公=======共=======方=======法==========区=========start============//
- /**
- * 列表分页查询 and isDelete = 0
- *
- */
- public String cg(){
- Map
alias = new HashMap(); - StringBuffer sb = new StringBuffer();
- sb = sb.append("from Cg where 1=1 ");
- sb = sb.append("order by id desc");
- Pager
pagers = cgService.findByAlias(sb.toString(),alias); - ActionContext.getContext().put("pagers", pagers);
- ActionContext.getContext().put("Obj", cg);
- return SUCCESS;
- }
-
- public String ucg(){
- Map
alias = new HashMap(); - StringBuffer sb = new StringBuffer();
- sb = sb.append("from Cg where 1=1 ");
- sb = sb.append("order by id desc");
- Pager
pagers = cgService.findByAlias(sb.toString(),alias); - ActionContext.getContext().put("pagers", pagers);
- ActionContext.getContext().put("Obj", cg);
- return SUCCESS;
- }
- /**
- * 跳转到添加页面
- * @return
- */
- public String add(){
- return SUCCESS;
- }
-
- /**
- * 执行添加
- * @return
- */
- public String exAdd(){
- cg.setAddTime(new Date());
- cgService.save(cg);
-
- ActionContext.getContext().put("url", "/cg_cg.do");
- return "redirect";
- }
-
- /**
- * 查看详情页面
- * @return
- */
- public String view(){
- Cg n = cgService.getById(cg.getId());
- ActionContext.getContext().put("Obj", n);
- return SUCCESS;
- }
-
- /**
- * 跳转修改页面
- * @return
- */
- public String update(){
- Cg n = cgService.getById(cg.getId());
- ActionContext.getContext().put("Obj", n);
- return SUCCESS;
- }
-
- /**
- * 执行修改
- * @return
- */
- public String exUpdate(){
- Cg n = cgService.getById(cg.getId());
- BeanUtils.copyProperties(cg, n, getNullPropertyNames(cg));
- cgService.update(n);
- ActionContext.getContext().put("url", "/cg_cg.do");
- return "redirect";
- }
-
-
- /**
- * 删除
- * @return
- */
- public String delete(){
- cgService.delete(cg.getId());
- ActionContext.getContext().put("url", "/cg_cg.do");
- return "redirect";
- }
-
- //=============公=======共=======方=======法==========区=========end============//
-
- //-------------------------华丽分割线---------------------------------------------//
-
- //=============自=======定=======义=========方=======法==========区=========start============//
-
-
-
-
- //=============自=======定=======义=========方=======法==========区=========end============//
-
-
-
- }
DtAction
- package com.my.pro.action;
-
- import org.springframework.beans.BeanUtils;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Controller;
- import org.springframework.web.bind.annotation.RequestMapping;
- import java.io.File;
-
- import javax.servlet.http.HttpSession;
- import org.apache.struts2.ServletActionContext;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.context.annotation.Scope;
- import org.springframework.stereotype.Controller;
- import com.opensymphony.xwork2.ActionContext;
- import com.opensymphony.xwork2.ActionSupport;
- import com.my.pro.utils.Pager;
- import com.opensymphony.xwork2.ModelDriven;
- import java.util.*;
-
- import com.my.pro.model.*;
- import com.my.pro.dao.*;
- import com.my.pro.service.*;
-
- /**
- * @ClassName:
- * @Description:
- * @author administrator
- *
- */
-
- @Controller("dtAction")
- @Scope("prototype")
- public class DtAction extends BaseAction implements ModelDriven
- {
-
- private static final long serialVersionUID = 1L;
-
-
-
- //==========model==============
- private Dt dt;
- @Override
- public Dt getModel() {
- if(dt==null) dt = new Dt();
- return dt;
- }
- //==========model==============
- /**
- * 依赖注入 start dao/service/===
- */
- @Autowired
- private DtService dtService;
-
- //依赖注入 end dao/service/===
-
- //-------------------------华丽分割线---------------------------------------------
-
- //============自定义参数start=============
-
- //============自定义参数end=============
-
-
- //-------------------------华丽分割线---------------------------------------------
-
- //============文件上传start=======================================================
-
-
- private File file;
- //提交过来的file的名字
- private String fileFileName;
- //提交过来的file的MIME类型
- private String fileContentType;
- public File getFile() {
- return file;
- }
- public void setFile(File file) {
- this.file = file;
- }
- public String getFileFileName() {
- return fileFileName;
- }
- public void setFileFileName(String fileFileName) {
- this.fileFileName = fileFileName;
- }
- public String getFileContentType() {
- return fileContentType;
- }
- public void setFileContentType(String fileContentType) {
- this.fileContentType = fileContentType;
- }
- //============文件上传end=========================================================
- public String jsonAction() {
- // dataMap中的数据将会被Struts2转换成JSON字符串,所以这里要先清空其中的数据
- jsonMap.clear();
- jsonMap.put("success", true);
- return JSON_TYPE;
- }
- //-------------------------华丽分割线---------------------------------------------//
-
- //=============公=======共=======方=======法==========区=========start============//
- /**
- * 列表分页查询 and isDelete = 0
- *
- */
- public String dt(){
- Map
alias = new HashMap(); - StringBuffer sb = new StringBuffer();
- sb = sb.append("from Dt where 1=1 ");
- sb = sb.append("order by id desc");
- Pager
- pagers = dtService.findByAlias(sb.toString(),alias);
- ActionContext.getContext().put("pagers", pagers);
- ActionContext.getContext().put("Obj", dt);
- return SUCCESS;
- }
-
- public String udt(){
- Map
alias = new HashMap(); - StringBuffer sb = new StringBuffer();
- sb = sb.append("from Dt where 1=1 ");
- sb = sb.append("order by id desc");
- Pager
- pagers = dtService.findByAlias(sb.toString(),alias);
- ActionContext.getContext().put("pagers", pagers);
- ActionContext.getContext().put("Obj", dt);
- return SUCCESS;
- }
-
- /**
- * 跳转到添加页面
- * @return
- */
- public String add(){
- return SUCCESS;
- }
-
- /**
- * 执行添加
- * @return
- */
- public String exAdd(){
- dt.setAddTime(new Date());
- dtService.save(dt);
- ActionContext.getContext().put("url", "/dt_dt.do");
- return "redirect";
- }
-
- /**
- * 查看详情页面
- * @return
- */
- public String view(){
- Dt n = dtService.getById(dt.getId());
- ActionContext.getContext().put("Obj", n);
- return SUCCESS;
- }
-
- /**
- * 跳转修改页面
- * @return
- */
- public String update(){
- Dt n = dtService.getById(dt.getId());
- ActionContext.getContext().put("Obj", n);
- return SUCCESS;
- }
-
- /**
- * 执行修改
- * @return
- */
- public String exUpdate(){
- Dt n = dtService.getById(dt.getId());
- BeanUtils.copyProperties(dt, n, getNullPropertyNames(dt));
- dtService.update(n);
- ActionContext.getContext().put("url", "/dt_dt.do");
- return "redirect";
- }
-
-
- /**
- * 删除
- * @return
- */
- public String delete(){
- dtService.delete(dt.getId());
- /*Dt n = dtService.getById(dt.getId());
- //n.setIsDelete(1);
- dtService.update(n);*/
- ActionContext.getContext().put("url", "/dt_dt.do");
- return "redirect";
- }
-
- //=============公=======共=======方=======法==========区=========end============//
-
- //-------------------------华丽分割线---------------------------------------------//
-
- //=============自=======定=======义=========方=======法==========区=========start============//
-
-
-
-
- //=============自=======定=======义=========方=======法==========区=========end============//
-
-
-
- }
如果也想学习本系统,下面领取。关注并回复:128ssh