Cloud lending library management system

This system is based on SSM (Spring+Spring MVC+MyBatis) framework knowledge to implement a simple cloud borrowing library management system. During the development process of the cloud lending library management system, three major frameworks were integrated, and the system functions were realized on the basis of the framework integration.
1. System overview
1.1 System function introduction
1. Functional modules
The background of this system is written using the SSM framework, and the front page is written using the current mainstream Bootstrap and jQuery frameworks. (For knowledge about Bootstrap, please refer to "Responsive Web Development Project Tutorial" written by Dark Horse Programmer).
The cloud lending book management system mainly implements two functional modules: user login module and book management module. The user login module is mainly used to realize user login and logout; the book management module is mainly used to manage books, such as new book recommendation, book borrowing, etc. .
2. Functional structure diagram
1.2 System architecture design
1. System structure level
According to different functions, the project structure of the cloud lending library management system can be divided into the following levels.
• Persistence object layer (persistence layer or persistence layer): This layer consists of several persistence classes (entity classes).
• Data Access Layer (DAO Layer): This layer consists of several DAO interfaces and MyBatis mapping files. The name of the DAO interface uniformly ends with Mapper, and the name of the mapping file of MyBatis must be the same as the name of the interface.
• Business logic layer (Service layer): This layer consists of several Service interfaces and implementation classes. The logic layer is mainly used to realize the business logic of the system.
• Web presentation layer: This layer mainly includes Controller classes and JSP pages in Spring MVC.
2. Relationships and functions of each level
1.3. Organizational structure of project files
1.4. Development environment and operating environment
1. Development environment The
development environment of the cloud lending library management system is as follows.
• Operating system: Windows 7.
• Web server: Tomcat 8.5.24.
• Java Development Kit: JDK 8.
• Development tools: IntelliJ IDEA 2019.3.2.
• Database: MySQL 5.7.17.
• Browser: Mozilla Firefox 84.0 (64-bit).
2. Database design
Tables involved in the system
The cloud lending book management system mainly includes two modules: user login and book management. The user login module will use the user table, and the book management module will use the book information table. In addition, in the library management module, after each book borrowing is completed, the system will record the book borrowing situation. Therefore, the library management module also needs a borrowing record table.
3. System environment construction
3.1 Dependencies that need to be introduced
Since the cloud lending library management system is developed based on the SSM framework and Maven, it is necessary to introduce the dependencies of these three frameworks in the project. In addition, the project also involves database connections, JSTL tags, etc., so other dependencies such as database connections, JSTL tags, etc. must also be introduced. The dependencies that the entire system needs to introduce are as follows.
1. Spring framework-related dependencies:
spring-context (Spring context); spring-tx (Spring transaction management); spring-jdbc
(Spring JDBC).
2. Dependencies related to the Spring MVC framework:
spring-webmvc (Spring MVC core).
3. MyBatis framework-related dependencies:
mybatis (MyBatis core).
4. Dependencies related to paging plugin: pagehelper (paging plugin).
The dependency of MyBatis and Spring integration: mybatis-spring (MyBatis and Spring integration).
5. Database driver dependency:
mysql-connector-java (mysql database driver).
6. Data source related dependencies: druid (database connection pool provided by Ali).
7. ServletAPI-related dependencies:
jsp-api (jsp pages use objects such as request) servlet-api (java files use
objects such as request).
8. JSTL tag library related dependencies:
jstl (jsp standard tag library); taglibs (taglibs instruction);
9. Jackson related dependencies:
jackson-core (jackson core); jackson-databind (jackson data conversion); jackson-annotations (jackson Core Notes).
3.2 Prepare database resources
Import sql files through SQL commands
After logging in to the database through MySQL 5.7 Command Line Client, create a database named cloudlibrary. Import the cloudlibrary.sql file provided in the book resources into the cloudlibrary database through the SQL command, and then import all the data used by the cloud library management system.
SQL commands for importing data
The specific SQL commands for creating a database and importing data are as follows.
(1) Create the database
CREATE DATABASE cloudlibrary;
(2) Select the created database
USE cloudlibrary;
(3) Import the database file, assuming that the file is in the root directory of the F disk, the import command is as follows:
source F:\cloudlibrary .sql;
In addition to using commands to import database files, you can also import database files through other database management tools, such as Navicat Premium and SQLyog.
3.3 Prepare the project environment
1. Create a project and introduce dependencies
In IntelliJ IDEA, create a Maven Web project named cloudlibrary, and configure the dependencies required by the system into the pom.xml file of the project.
2. Write the configuration file and configuration class (1) Create the configuration file jdbc.properties
of the database connection information under the src\main\resources directory of the project. The content of the jdbc.properties configuration file is as follows: jdbc.driverClassName=com.mysql.cj.
jdbc.Driver jdbc.url=jdbc:mysql://localhost:3306/cloudlibrary_plus?useUnico de=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai jdbc.username=root
jdbc.password=root
(2) This project uses pure annotations to integrate the SSM framework, and uses configuration classes to replace the relevant configuration files of the framework. Create a class package named com.iheima.config under the src\main\java directory of the project, and create and configure the following six configuration classes under the config class package.
Configuration classes under the config class package
•ServletContainersInitConfig.java: The configuration class used to initialize the Servlet container.
•JdbcConfig.java: Configuration class for reading database connection information.
•MyBatisConfig.java: MyBatis related configuration class.
•SpringConfig.java: Spring-related configuration classes.
•SpringMvcConfig.java: Spring MVC-related configuration classes.
•EncodingFilter.java: Encoding interceptor. Import page resources
Import the CSS files, pictures, js and JSP files required for project operation into the project according to the organizational structure of the project files. Among them, the index.jsp on the home page of the system implements a forwarding function, which will be forwarded to the login page when accessed, and the implementation code is as follows.
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<jsp:forward page="/admin/login.jsp"/>
page effect display
Publish the project to the Tomcat server, start the project cloudlibrary, and visit the project homepage in the browser, the access address is http://localhost:8080 /cloudlibrary/index.jsp, the access effect is shown in the figure
4. User login module
...

For detailed documents, please refer to:
https://mp.weixin.qq.com/s?__biz=MzI2MjUyNzI5Ng==&mid=2247484789&idx=1&sn=74a2e92382d5e124bcbebf91e1b11679&chksm=ea48855add3f0c4cfb0f0246b 9af588a3039efcda75006e925b4281b66b2000710c45f8b872e #rd

おすすめ

転載: blog.csdn.net/qq_45707966/article/details/130631708