• Java项目:SSHJava基于ssh的教研室资料管理系统前后台


    作者主页:夜未央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

    1. package com.my.pro.action;
    2. import java.util.HashMap;
    3. import org.springframework.beans.BeanUtils;
    4. import java.util.Map;
    5. import org.springframework.beans.factory.annotation.Autowired;
    6. import org.springframework.stereotype.Controller;
    7. import org.springframework.web.bind.annotation.RequestMapping;
    8. import java.io.File;
    9. import java.util.ArrayList;
    10. import java.util.HashMap;
    11. import java.util.List;
    12. import java.util.Map;
    13. import javax.servlet.http.HttpSession;
    14. import org.apache.struts2.ServletActionContext;
    15. import org.springframework.beans.factory.annotation.Autowired;
    16. import org.springframework.context.annotation.Scope;
    17. import org.springframework.stereotype.Controller;
    18. import com.opensymphony.xwork2.ActionContext;
    19. import com.opensymphony.xwork2.ActionSupport;
    20. import com.my.pro.utils.Pager;
    21. import com.opensymphony.xwork2.ModelDriven;
    22. import java.util.*;
    23. import com.my.pro.model.*;
    24. import com.my.pro.dao.*;
    25. import com.my.pro.service.*;
    26. /**
    27. * @ClassName:
    28. * @Description:
    29. * @author administrator
    30. *
    31. */
    32. @Controller("cgAction")
    33. @Scope("prototype")
    34. public class CgAction extends BaseAction implements ModelDriven{
    35. private static final long serialVersionUID = 1L;
    36. //==========model==============
    37. private Cg cg;
    38. @Override
    39. public Cg getModel() {
    40. if(cg==null) cg = new Cg();
    41. return cg;
    42. }
    43. //==========model==============
    44. /**
    45. * 依赖注入 start dao/service/===
    46. */
    47. @Autowired
    48. private CgService cgService;
    49. //依赖注入 end dao/service/===
    50. //-------------------------华丽分割线---------------------------------------------
    51. //============自定义参数start=============
    52. //============自定义参数end=============
    53. //-------------------------华丽分割线---------------------------------------------
    54. //============文件上传start=======================================================
    55. private File file;
    56. //提交过来的file的名字
    57. private String fileFileName;
    58. //提交过来的file的MIME类型
    59. private String fileContentType;
    60. public File getFile() {
    61. return file;
    62. }
    63. public void setFile(File file) {
    64. this.file = file;
    65. }
    66. public String getFileFileName() {
    67. return fileFileName;
    68. }
    69. public void setFileFileName(String fileFileName) {
    70. this.fileFileName = fileFileName;
    71. }
    72. public String getFileContentType() {
    73. return fileContentType;
    74. }
    75. public void setFileContentType(String fileContentType) {
    76. this.fileContentType = fileContentType;
    77. }
    78. //============文件上传end=========================================================
    79. public String jsonAction() {
    80. // dataMap中的数据将会被Struts2转换成JSON字符串,所以这里要先清空其中的数据
    81. jsonMap.clear();
    82. jsonMap.put("success", true);
    83. return JSON_TYPE;
    84. }
    85. //-------------------------华丽分割线---------------------------------------------//
    86. //=============公=======共=======方=======法==========区=========start============//
    87. /**
    88. * 列表分页查询 and isDelete = 0
    89. *
    90. */
    91. public String cg(){
    92. Map alias = new HashMap();
    93. StringBuffer sb = new StringBuffer();
    94. sb = sb.append("from Cg where 1=1 ");
    95. sb = sb.append("order by id desc");
    96. Pager pagers = cgService.findByAlias(sb.toString(),alias);
    97. ActionContext.getContext().put("pagers", pagers);
    98. ActionContext.getContext().put("Obj", cg);
    99. return SUCCESS;
    100. }
    101. public String ucg(){
    102. Map alias = new HashMap();
    103. StringBuffer sb = new StringBuffer();
    104. sb = sb.append("from Cg where 1=1 ");
    105. sb = sb.append("order by id desc");
    106. Pager pagers = cgService.findByAlias(sb.toString(),alias);
    107. ActionContext.getContext().put("pagers", pagers);
    108. ActionContext.getContext().put("Obj", cg);
    109. return SUCCESS;
    110. }
    111. /**
    112. * 跳转到添加页面
    113. * @return
    114. */
    115. public String add(){
    116. return SUCCESS;
    117. }
    118. /**
    119. * 执行添加
    120. * @return
    121. */
    122. public String exAdd(){
    123. cg.setAddTime(new Date());
    124. cgService.save(cg);
    125. ActionContext.getContext().put("url", "/cg_cg.do");
    126. return "redirect";
    127. }
    128. /**
    129. * 查看详情页面
    130. * @return
    131. */
    132. public String view(){
    133. Cg n = cgService.getById(cg.getId());
    134. ActionContext.getContext().put("Obj", n);
    135. return SUCCESS;
    136. }
    137. /**
    138. * 跳转修改页面
    139. * @return
    140. */
    141. public String update(){
    142. Cg n = cgService.getById(cg.getId());
    143. ActionContext.getContext().put("Obj", n);
    144. return SUCCESS;
    145. }
    146. /**
    147. * 执行修改
    148. * @return
    149. */
    150. public String exUpdate(){
    151. Cg n = cgService.getById(cg.getId());
    152. BeanUtils.copyProperties(cg, n, getNullPropertyNames(cg));
    153. cgService.update(n);
    154. ActionContext.getContext().put("url", "/cg_cg.do");
    155. return "redirect";
    156. }
    157. /**
    158. * 删除
    159. * @return
    160. */
    161. public String delete(){
    162. cgService.delete(cg.getId());
    163. ActionContext.getContext().put("url", "/cg_cg.do");
    164. return "redirect";
    165. }
    166. //=============公=======共=======方=======法==========区=========end============//
    167. //-------------------------华丽分割线---------------------------------------------//
    168. //=============自=======定=======义=========方=======法==========区=========start============//
    169. //=============自=======定=======义=========方=======法==========区=========end============//
    170. }

    DtAction

    1. package com.my.pro.action;
    2. import org.springframework.beans.BeanUtils;
    3. import org.springframework.beans.factory.annotation.Autowired;
    4. import org.springframework.stereotype.Controller;
    5. import org.springframework.web.bind.annotation.RequestMapping;
    6. import java.io.File;
    7. import javax.servlet.http.HttpSession;
    8. import org.apache.struts2.ServletActionContext;
    9. import org.springframework.beans.factory.annotation.Autowired;
    10. import org.springframework.context.annotation.Scope;
    11. import org.springframework.stereotype.Controller;
    12. import com.opensymphony.xwork2.ActionContext;
    13. import com.opensymphony.xwork2.ActionSupport;
    14. import com.my.pro.utils.Pager;
    15. import com.opensymphony.xwork2.ModelDriven;
    16. import java.util.*;
    17. import com.my.pro.model.*;
    18. import com.my.pro.dao.*;
    19. import com.my.pro.service.*;
    20. /**
    21. * @ClassName:
    22. * @Description:
    23. * @author administrator
    24. *
    25. */
    26. @Controller("dtAction")
    27. @Scope("prototype")
    28. public class DtAction extends BaseAction implements ModelDriven
      {
    29. private static final long serialVersionUID = 1L;
    30. //==========model==============
    31. private Dt dt;
    32. @Override
    33. public Dt getModel() {
    34. if(dt==null) dt = new Dt();
    35. return dt;
    36. }
    37. //==========model==============
    38. /**
    39. * 依赖注入 start dao/service/===
    40. */
    41. @Autowired
    42. private DtService dtService;
    43. //依赖注入 end dao/service/===
    44. //-------------------------华丽分割线---------------------------------------------
    45. //============自定义参数start=============
    46. //============自定义参数end=============
    47. //-------------------------华丽分割线---------------------------------------------
    48. //============文件上传start=======================================================
    49. private File file;
    50. //提交过来的file的名字
    51. private String fileFileName;
    52. //提交过来的file的MIME类型
    53. private String fileContentType;
    54. public File getFile() {
    55. return file;
    56. }
    57. public void setFile(File file) {
    58. this.file = file;
    59. }
    60. public String getFileFileName() {
    61. return fileFileName;
    62. }
    63. public void setFileFileName(String fileFileName) {
    64. this.fileFileName = fileFileName;
    65. }
    66. public String getFileContentType() {
    67. return fileContentType;
    68. }
    69. public void setFileContentType(String fileContentType) {
    70. this.fileContentType = fileContentType;
    71. }
    72. //============文件上传end=========================================================
    73. public String jsonAction() {
    74. // dataMap中的数据将会被Struts2转换成JSON字符串,所以这里要先清空其中的数据
    75. jsonMap.clear();
    76. jsonMap.put("success", true);
    77. return JSON_TYPE;
    78. }
    79. //-------------------------华丽分割线---------------------------------------------//
    80. //=============公=======共=======方=======法==========区=========start============//
    81. /**
    82. * 列表分页查询 and isDelete = 0
    83. *
    84. */
    85. public String dt(){
    86. Map alias = new HashMap();
    87. StringBuffer sb = new StringBuffer();
    88. sb = sb.append("from Dt where 1=1 ");
    89. sb = sb.append("order by id desc");
    90. Pager
      pagers = dtService.findByAlias(sb.toString(),alias);
    91. ActionContext.getContext().put("pagers", pagers);
    92. ActionContext.getContext().put("Obj", dt);
    93. return SUCCESS;
    94. }
    95. public String udt(){
    96. Map alias = new HashMap();
    97. StringBuffer sb = new StringBuffer();
    98. sb = sb.append("from Dt where 1=1 ");
    99. sb = sb.append("order by id desc");
    100. Pager
      pagers = dtService.findByAlias(sb.toString(),alias);
    101. ActionContext.getContext().put("pagers", pagers);
    102. ActionContext.getContext().put("Obj", dt);
    103. return SUCCESS;
    104. }
    105. /**
    106. * 跳转到添加页面
    107. * @return
    108. */
    109. public String add(){
    110. return SUCCESS;
    111. }
    112. /**
    113. * 执行添加
    114. * @return
    115. */
    116. public String exAdd(){
    117. dt.setAddTime(new Date());
    118. dtService.save(dt);
    119. ActionContext.getContext().put("url", "/dt_dt.do");
    120. return "redirect";
    121. }
    122. /**
    123. * 查看详情页面
    124. * @return
    125. */
    126. public String view(){
    127. Dt n = dtService.getById(dt.getId());
    128. ActionContext.getContext().put("Obj", n);
    129. return SUCCESS;
    130. }
    131. /**
    132. * 跳转修改页面
    133. * @return
    134. */
    135. public String update(){
    136. Dt n = dtService.getById(dt.getId());
    137. ActionContext.getContext().put("Obj", n);
    138. return SUCCESS;
    139. }
    140. /**
    141. * 执行修改
    142. * @return
    143. */
    144. public String exUpdate(){
    145. Dt n = dtService.getById(dt.getId());
    146. BeanUtils.copyProperties(dt, n, getNullPropertyNames(dt));
    147. dtService.update(n);
    148. ActionContext.getContext().put("url", "/dt_dt.do");
    149. return "redirect";
    150. }
    151. /**
    152. * 删除
    153. * @return
    154. */
    155. public String delete(){
    156. dtService.delete(dt.getId());
    157. /*Dt n = dtService.getById(dt.getId());
    158. //n.setIsDelete(1);
    159. dtService.update(n);*/
    160. ActionContext.getContext().put("url", "/dt_dt.do");
    161. return "redirect";
    162. }
    163. //=============公=======共=======方=======法==========区=========end============//
    164. //-------------------------华丽分割线---------------------------------------------//
    165. //=============自=======定=======义=========方=======法==========区=========start============//
    166. //=============自=======定=======义=========方=======法==========区=========end============//
    167. }

    如果也想学习本系统,下面领取。关注并回复:128ssh

  • 相关阅读:
    idea快捷键
    Java面试题:请谈谈Java中的volatile关键字?
    LeetCode790多米诺和托米诺平铺
    java计算机毕业设计无人值守台球厅智能管理监控系统源码+数据库+lw文档+系统+部署
    一技在身,天下我有
    ES相关学习
    Git操作指南:子模块、用户名修改和Subtree
    Sonic云真机学习总结6 - 1.4.1服务端、agent端部署
    小文件存到HDFS占用空间是文件实际大小,而非一个block块的大小
    ES6的symbol及es2021
  • 原文地址:https://blog.csdn.net/hanyunlong1989/article/details/127132056