This time we introduce the design and implementation of a student dormitory management system based on SSM+JSP. The interface is simple and the program logic is clear. It is suitable as a template reference for graduation design!
A few days ago, I found a giant artificial intelligence learning website. It is easy to understand, humorous, and I can’t help but share it with everyone.
The significance of the project and its background
With the rapid development of microcomputer technology, network technology and corresponding software technology in recent years, school management and students' campus life are increasingly inseparable from computers. In order to better manage student dormitory information and greatly improve the efficiency of student dormitory information management, this topic - dormitory information management system was developed
Tools and their environment preparation
-
Java Compiler (IDEA)
-
Mysql database
-
Maven project management tool
-
Tomcat server
Related help articles (click the link to enter the article)
(1) Maven detailed installation process explanation
(2) A collection of development tools
technology stack
Front-end: HTML, CSS, Jquery, JSP, Layui framework
Backend: SpringBoot, Mybatis, SpringMVC
Database: Mysql8
Middleware: JSTL tag library, dbcp2 connection pool
functional module
-
Dormitory management (dormitory list, personnel information, maintenance registration)
-
Health management (student health, dormitory health)
-
Administrator management (manage administrator accounts)
-
Student management (student number cannot be repeated)
-
Class management (class numbers cannot be repeated)
-
Visitor management (record visit information)
-
Administrator login (username, password, verification code verification)
Notice:
1. The tabular data of each module can be exported as an Excel file
2. Except for the user login function, other functions will be intercepted by the login interceptor. If there is no user information in the session, return to the login page to log in
The login interceptor code is as follows:
package com.interceptor; import com.po.Admin; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.HandlerInterceptor; import org.springframework.web.servlet.ModelAndView; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; /** * login interceptor */ public class Loginlnterceptor implements HandlerInterceptor { @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { //Get the requested URL String url = request.getRequestURI(); //URL: Except login.jsp is publicly accessible, all other URLs are intercepted and controlled if(url.indexOf("/login")>=0){ return true; } //Get Session HttpSession session = request.getSession(); Object admin = session.getAttribute("admin"); //Determine whether there is user data in the Session, if so, return true, and continue to execute if(admin != null){ return true; } //If the conditions are not met, a prompt message will be given and forwarded to the main page request.setAttribute("msg", "You have not logged in, please log in first!"); request.getRequestDispatcher("/") .forward(request, response); return false; } @Override public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { } @Override public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { } }
Project mind map
Demonstration effect
login page
front page
student management
maintenance registration
Dormitory list
Dormitory hygiene
visitor list
administrator list
The background picture of the homepage is added by myself.
, if you want to change, you can change the style code of the wedapp/WEB-INF/jsp/homepage.jsp file
.o_div{ /* background image*/ background: url("/images/back.jpg") no-repeat; background-position: 400px -10px; background-size: cover; }
Run through project ideas
I have shown you the process of building the SSM library management system earlier, which is similar to the idea of building this system. If you don’t know how to do it, please watch more video operations. I will describe it in concise words below:
Step 1: Install all the necessary environments required for the project, such as Mysql, Maven, Tomcat, IntelliJ IDEA
Step 2: Import the project to the IDEA compiler, reconfigure Maven parameters, and install Maven's articles:
Maven detailed installation process explanation
Step 3: Open the db.properties file, modify Mysql connection parameters, such as Mysql driver (default is version 8, if you are version 5 remove cj), password and other information
Step 4: Set the project JDK version to 1.8
Step 5: Use the local Tomcat to run this project. If the console does not report an error and the pop-up page is 404, this is mostly caused by a Tomcat version problem. Solve this problem according to the following article
https://www.bilibili.com/read/cv20323773
Congratulations, the construction steps of this project are all completed🌟
How to get the source code
Follow the official account of "Source Code Inn" and reply to "dormitory" to get the relevant source code link
about login
The password of the administrator is encrypted using MD5, so you cannot check the administrator table (d_admin) to know the password, because there will be some data after the sql file is imported, you can log in to the following account
Account: admin
Password: 123456
write at the end
If there is a problem with the operation of the project, friends, don’t worry, check the possible problems slowly, I wish you a successful operation! It's not easy to sort out, welcome to pay attention😀, like👍, bookmark⭐