How to quickly build SSM framework project with IDEA

Download the data from Baidu Cloud Disk and import the file to ideal quickly to create a project link immediately
: https://pan.baidu.com/s/1aIPeLn6QYqyPr4ARUKmTag Extraction code: khwn

For detailed steps:
Step 1: Create a new project, project or new module moudule, my case is to create a new moudle, newcomers are best to create a new project project.
Insert picture description here
Step 2: In the following interface, the next step can be
Insert picture description here
the third Step: The name needed for the new project, fill in as you like
Insert picture description here

Step 4: Go to the following interface directly to the next step
Insert picture description here




Step 5: The above project is successfully created. The following is an introduction to the newly created moudle module. It is almost the same as the above. I will use the module to introduce the project construction process
Insert picture description here
. Steps 6 and 7: Press next
Insert picture description here
. Step 8: Fill in the module name and go to the next step , Press next to
Insert picture description here
create a successful project
. Step 9: Right-click the project, the following interface pops up, and then click Add Framework Support
Insert picture description here

Step 10: After the above click, the following page will appear, and then select Web to tick it, that is, select.
Insert picture description here

Step 11: General structure of the project
Insert picture description here

Step 12: Find the pom file and copy the following content into it, which is to import a series of jar packages of the SSM framework. The following are the jar packages
Insert picture description here
that need to be imported to build the SSM framework. Copy and paste into the empty space under the artifactId label in the pom file. Just place.

<dependencies>
        <!--数据库连接池-->
        <dependency>
            <groupId>com.mchange</groupId>
            <artifactId>c3p0</artifactId>
            <version>0.9.5.2</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jsp-api</artifactId>
            <version>2.0</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <version>1.0</version>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.47</version>
        </dependency>
        <dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis</artifactId>
            <version>3.5.2</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>5.1.9.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
            <version>5.1.9.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjweaver</artifactId>
            <version>1.8.13</version>
        </dependency>
        <dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis-spring</artifactId>
            <version>2.0.2</version>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.16.22</version>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.17</version>
        </dependency>
        <!--静态资源导出问题-->
    </dependencies>
    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <includes>
                    <include>**/*.properties</include>
                    <include>**/*.xml</include>
                </includes>
                <filtering>true</filtering>
            </resource>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.properties</include>
                    <include>**/*.xml</include>
                </includes>
                <filtering>true</filtering>
            </resource>
        </resources>
    </build>

Step 13: Find the web.xml file and copy
Insert picture description here
the following content to the blank space of the file. Copy the following content to the blank space of the web.xml file:

<!--DispatchServlet-->
    <servlet>
        <servlet-name>springmvc</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath:applicationContext.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>springmvc</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>

    <session-config>
        <session-timeout>15</session-timeout>
    </session-config>

Step 14: Then right-click the WEB-INF file to create a new jsp file, and then create a new query.jsp file in the jsp
Insert picture description here

Insert picture description here
Step 15:
1. Copy the top com from the download file in the Baidu cloud disk to the java folder in the project
2. Copy the various configuration files in the resources to the corresponding resources in the project
The result after copying is shown in the figure below:
Insert picture description here

Step 15: Configure the project to tomcat. First, create a new tomcat
Insert picture description here
. Step 16: Create a local tomcat
Insert picture description here
and select the version of tomcat downloaded on your computer must be tomcat 8.0 or above
Insert picture description here

Step 17: Adding images in accordance with the project package, click the plus sign, then click on the first one, select the item with the name of your own creation
Insert picture description here
Insert picture description here
Step 18: Deployment Project success then select Apply to apply it, and finally click the ok button
Insert picture description here
last The project has been as shown in the figure below, and then click the run button to run tomcat. Note that the project will have a 404 situation, so the next step is required.
Insert picture description here
Step 19: Click the link below to solve the 404 problem of project access, which is to load the jar package for the project. This is an idea or a common problem. If you still have problems, you can comment and leave a message.

https://blog.csdn.net/qq_34134299/article/details/114012376

Guess you like

Origin blog.csdn.net/qq_34134299/article/details/114029106