pause update )管理员: Have permissions to all information management modules教师: Have all permissions in the student information management module, but only the permissions in the teacher information management module are to query and modify personal information.学生: Only have permission to query and modify personal informationThe core example code for setting permissions is as follows (no security framework is used):
// 用户权限设置: 如果当前用户类型为教师,则将其权限设置为仅能查询个人信息
if ( userType == 3 ) {
TeacherInfo currentTeacherInfo = ( TeacherInfo ) request . getSession (). getAttribute ( "userInfo" );
teacherInfo . setId ( currentTeacherInfo . getId ());
}
// 获取分页后的教师列表信息
List < TeacherInfo > teacherList = teacherDao . getTeacherList ( teacherInfo , new Paging ( currentPage , pageSize ));| tool | Version or description |
|---|---|
OS | Windows 10 |
JDK | 11.0.2 |
IDE | Eclipse EE 2018-12 (4.10.0) |
Server | Apache Tomcat v9.0 |
MySQL | 8.0.11 |
The database version of this project is
8.0.11. Please note that students with version5.0.0+can create this database by copying the table structure one by one.
│
└─student_information_management_system
│
│
├─database
│ SMS.sql
│
├─src
│ │ databaseConfig.properties
│ │
│ └─pers
│ └─huangyuhui
│ └─sms
│ ├─dao
│ │ AdminDao.java
│ │ BasicDao.java
│ │ ClazzDao.java
│ │ StudentDao.java
│ │ TeacherDao.java
│ │
│ ├─filter
│ │ LoginFilter.java
│ │
│ ├─model
│ │ AdminInfo.java
│ │ ClazzInfo.java
│ │ Paging.java
│ │ StudentInfo.java
│ │ TeacherInfo.java
│ │
│ ├─servlet
│ │ ClazzManagementServlet.java
│ │ LoginServlet.java
│ │ OutVerifiCodeServlet.java
│ │ PersonalManagementServlet.java
│ │ PhotoServlet.java
│ │ StuManagementServlet.java
│ │ SysMainInterfaceServlet.java
│ │ TeacherManagementServlet.java
│ │
│ └─util
│ CreateVerifiCodeImage.java
│ DbConfig.java
│ DbUtil.java
│ StringUtil.java
│
└─WebContent
│ index.jsp
│ refresh.jsp
│
├─easyui
│ │
│ ├─css
│ │
│ ├─js
│ │
│ └─themes
│
│
├─h-ui
│ │
│ ├─css
│ │
│ ├─images
│ │
│ ├─js
│ │
│ ├─lib
│ │
│ └─skin
│
│
├─META-INF
│ MANIFEST.MF
│
├─resource
│ └─image
│ default_portrait.jpg
│
└─WEB-INF
│ web.xml
│
├─lib
│ commons-beanutils-1.8.3.jar
│ commons-collections-3.2.1.jar
│ commons-fileupload-1.2.1.jar
│ commons-io-1.4.jar
│ commons-lang-2.5.jar
│ commons-logging-1.1.1.jar
│ ezmorph-1.0.6.jar
│ FilelLoad.jar
│ json-lib-2.3-jdk15.jar
│ jsonplugin-0.34.jar
│ jstl.jar
│ mysql-connector-java-8.0.11.jar
│ standard.jar
│
└─view
│ login.jsp
│
├─class
│ classList.jsp
│
├─error
│ 404.jsp
│ 500.jsp
│
├─management
│ personalView.jsp
│
├─student
│ studentList.jsp
│
├─system
│ main.jsp
│ welcome.jsp
│
└─teacher
teacherList.jsp
SMS.sql
databaseConfig.properties
H-ui front-end framework h-ui/
EasyUI front-end framework easyui/
Looking back and carefully reading and thinking about the source code of the project, I was surprised to find that the code in the project has many areas that need to be optimized. After all, this is my first Java web project, so please forgive me~ In order to let you write more beautiful code and more extensible projects, I will give you a project that is very suitable for beginner design patterns for students to learn and refer to: https://github.com/YUbuntu0109/design-patterns-in-java
For more interesting projects and detailed study notes, please go to my personal blog (づ ̄3 ̄)づ╭~ : https://yubuntu0109.github.io/
Learning notes are all open source: https://github.com/YUbuntu0109/YUbuntu0109.github.io
Look forward to your contribution, if you need any help, please contact me~ QQ: 3083968068