Dieser Artikel hat den ersten Artikel der Bibliothekssystem -Bibliotheksmanagementsystementwicklung für Ihre Referenz. Der spezifische Inhalt ist wie folgt
SSM -Konstruktionsprozess:
Der allgemeine Prozess der Erstellung eines Ideenprojekts
Offene Idee ---> Datei ---> Neu ---> Projekt ---> Maven --->
Erstellen Sie aus dem Archetyp ---> Maven-Archetype-Webapp ---> Als nächstes handelt es sich normalerweise um Standard
Erstellen Sie schließlich einen neuen Java- und Ressourcenordner im Hauptverzeichnis.
Schritt 1: Fügen Sie Feder, Feder MVC, MyBatis -Abhängigkeiten hinzu
Alle haben detaillierte Anweisungen, daher werde ich sie hier nicht wiederholen
pom.xml
<? xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.ray</groupId> <artifactId>LibrarySystem02</artifactId> <version> 1.0-Snapshot </Version> <Pakete> Krieg </packaging> <name> bibliothekSystem02 Maven WebApp </name> <!-FixMe Ändern Sie es auf der Website des Projekts-> <URL> http://www.example.com </url> <Propions> <project.build.sourceencoding> utf-8 </project.build.sourceencoding> <maven.compiler.source> 1.7 </maven.compiler.source> <maven.compiler.target> 1.7 </maven.comPiler.target> <!-Variable-Nr. <Logback.version> 1.1.1 </logback.version> <mysql.version> 5.1.18 </mysql.version> <com.alibaba.druid.version> 1.1.9 </com.alibaba.druid.version> <com.mybatis.mybatis.version> 3.4.1 </com.mybatis.mybatis.version> <com.mybatis.mybatis_spring.version> 1.3.0 </com.mybatis.mybatis_spring.version.version.version.version <org.springframework.version>4.3.2.RELEASE</org.springframework.version> <slf4j.version>1.7.18</slf4j.version> <log4j.version>1.2.17</log4j.version> <jackson-mapper-asl.version>1.9.13</jackson-mapper-asl.version> <jackson.version> 2.9.2 </jackson.version> <fastjson.version> 1.2.47 </fastjson.version> <org.mybatis.Generator.version> 1.3.5 </Org.mybatis.generator.version> </gruppies> <! <artifactId>junit</artifactId> <version>4.11</version> <scope>test</scope> </dependency> <!-- 0.Log--> <!-- Implement slf4j interface and integrate--> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> <version>${logback.version}</version> </abhängig> <!-1.Database-> <De vorstellen> <gruppe> MySQL </GroupId> <artifactId> Mysql-Konnektor-Java </artifactId> <version> $ {mysql.version} </Version> <Scope> RunTime </scopecy> </abhängig> </abhängig> <! <groupId>com.alibaba</groupId> <artifactId>druid</artifactId> <version>${com.alibaba.druid.version}</version> </dependency> <!-- DAO: MyBatis --> <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> <version> $ {com.mybatis.mybatis.version} </Version> </abhängig> <abhängigkeit> <GroupID> org.mybatis </gruppeId> <artifactId> mybatis-pring </artifactId> <version> $ {com.mybatis.mybatis_Spring.Spring.Spring.Pring.Spring.Pring.Spring.Sprall web-> <depeencing> <gruppe> jstl </gruppeId> <artifactId> jstl </artifactId> <version> 1.2 </Version> </abhängig> <!-Servlet-Versionseinstellungen-> <Deponierung> <GroupId> javax.servlet </gruppen> <artifactid> javax.Servlet-api </artifactid> <version> $ {javax.servlet.version} </Version> </abhängig> <!-3.spring-> <!-1) Spring Core-> <Dependent> <GroupId> org.springFramework </GroupId> <artifactID> Spring-Core </artifactId> <version> $ {{org.Spring. <gruppeId> org.springFramework </gruppeId> <artifactId> Spring-Beer </artifactId> <version> $ {org.springframework.version} </Version> </abhängig> <depelzipe> <gruppeId> org.springFramework </gruppen> <artifactIdId> feder-context </artifactid> <version> $ {org.springFramework.version} </Version> </abhängig> <!-2) Spring DAO-Schicht-> <De vorstellen> <GroupID> org.springFramework </GroupId> <Argnactid> Spring-Jdbc </artifactID> <version> {org.springFramework.version} </Version> </{org.springFramework. <gruppeId> org.springFramework </Groupid> <artifactId> Spring-Tx </artifactId> <version> $ {org.springFramework.version} </Version> </abhängig> <!-3) Spring Web-> <Depopact> <gruppe org.SpringFrame </gruppe </gruppe> <artifactid> frack </gruppe </gruppen> <artifactid> fr. <version> $ {org.springFramework.version} </Version> </abhängig> <depeation> <gruppe org. <groupId>org.springframework</groupId> <artifactId>spring-test</artifactId> <version>${org.springframework.version}</version> </dependency> <!-- Input JSON --> <dependency> <groupId>org.codehaus.jackson</groupId> <artifactId>jackson-mapper-asl</artifactId> <version> $ {Jackson-mapper-asl.version} </Version> </abhängig> <depeopcy> <gruppe> com.fasterxml.jackson.core </gruppen> <artifactid> jackson-core </artifactid> <version> $ {Jackson.version} </Version> </vgl. <gruppe> com.fasterxml.jackson.core </Groupid> <artifactId> Jackson-Databind </artifactID> <version> $ {Jackson.version} </Version> </abhängig> <!-FASTJSON-FASTJSON-FASTJSON-FASTJSON add> </artifactid> fastjson add. <version> $ {fastjson.version} </Version> </abhängig> </abhängig> <builds> <finalName> bibliothekSystem02 </finalName> <Pluginmanagement> <!-Versionen sperren, um die Verwendung von Maven-Standards (kann auf Elternpom) zu vermeiden. <version> 3.0.0 </Version> </plugin> <!-siehe http://maven.apache.org/ref/current/maven-core/default-bindings.html#plugin_bindings_for_war_packaging-artifactIfactid> maven-resources-plegin- <version> 3.0.2 </Version> </plugin> <plugin> <artifactId> maven-compiler-plugin </artifactId> <version> 3.7.0 </Version> </plugin> <plugin> <artifactId> maven-surefire-plugin </artifactid> <version> 2.20.1 </sure <artifactId> maven-kriege-plugin </artifactId> <version> 3.2.0 </Version> </plugin> <plugin> <artifactid> mavenin-install-plugin </artifactId> <version> 2.5.2 </Version> </plugin> <artifactid> </artifactid> 2.-Maven-deploy-plugin </artifactid> 2.- maven-deploy-ploy-plugin </artifactid> 2.- maven-deploy-ploy-ploy-ploy-ploy-ploy-ploy-ploy-ploy-ploy-ploy-ploy-ploys </plugin> <!-- Reverse Engineering mybatis-generator --> <plugin> <groupId>org.mybatis.generator</groupId> <artifactId>mybatis-generator-maven-plugin</artifactId> <version>${org.mybatis.generator.version}</version> <configuration> <verbose>true</verbose> <Overwrite> true </overwrite> </configuration> <abhängigkeiten> <depeopentcy> <GroupId> org.mybatis </Groupid> <artifactId> mybatis </artifactId> <version> $ {com.mybatis.mybatis.version} </Version> </vgl. <artifactid> mysql-connector-java </artifactid> <version> $ {mysql.version} </Version> </abhängig> </abhängig> </plugin> </plugins> </plugins> </pluginmanagement> </build> </project> </project> </project>Schritt 2: Fügen Sie eine Datenbank hinzu
Hier müssen Sie eine Datenbank mit dem Titel: Bibliothek erstellen
Die Erstellungserklärung der Tabelle lautet wie folgt:
# Host: Localhost (Version 6.0.11-Alpha-Community) # Datum: 2018-05-22 20:31:40 # Generator: MySQL-FRONT 6.0 (Build 2.20) # # Struktur für Tabelle "Buch" # Droptabelle Wenn existiert `book`; Erstellen Sie Tabelle `book` (` id` bigint (20) nicht null auto_increment, `book_name` varchar (255) nicht null,` book_writer` varchar (255) nicht null, `book_publisher` varchar (255) nicht null,` book_isrent `bigin (20) null,` bookn (20), nicht, null, `bookn (20), nicht, null,` bookn (20), nicht, null, `bookn (20), nicht, null,` bookn (20), nicht, null, `bookn (20), nicht, null,` bookn (20), nicht, null, `bookn (20), nicht, null,` bookn (20), nicht, null, `bookn (20), no, no, no, no, No. (`id`)) motor = innoDB auto_increment = 5 Standard charSet = utf8; # Data for table "book" # INSERT INTO `book` VALUES (1,'machine learning','Zhou Zhihua','Tsinghua University Press',1,'linyue'),(2,'Practical machine learning','People','People' Posts and Telecommunications Press',1,'linyue'),(4,' Introduction to Algorithm','Thomas','Mechanical Industry Drücken Sie ', 0,' '); # # Struktur für die Tabelle "Benutzer" # Droptabelle, wenn `user``; Erstellen Sie Tabelle `user` (` id` bigint (11) nicht null auto_increment, `user_name` varchar (40) nicht null,` user_email` varchar (50) NICHT NULL, `user_pwd` varchar (50), nicht null, primärer Schlüssel (`)). # Data for table "user" # INSERT INTO `user` VALUES (1,'linyue','[email protected]','123'),(3,'rain','[email protected]','222'),(4,'ray','[email protected]','333'),(5,'test','[email protected]','123');
Laden Sie die vollständige Projektdemo herunter: LibrarySystem02
Das obige ist der gesamte Inhalt dieses Artikels. Ich hoffe, es wird für das Lernen aller hilfreich sein und ich hoffe, jeder wird Wulin.com mehr unterstützen.