Build a simple SSM framework using idea: (1) Use idea to create a maven project, ssmmaven

Source: Internet
Author: User

Build a simple SSM framework using idea: (1) Use idea to create a maven project, ssmmaven

The development environment is idea2016.3.5 + maven and the spring version is 4.1.7.

Note the following when using idea to create a maven project:

1. Select the simple java application option as shown in

2. You must add the archetypeCatalog = internal option during creation. Otherwise, the creation may fail, or it may be stuck in the creation process all the time.

Next, click next and select the project location. Click finish to create the maven project. Of course, after creation, you may find many missing folders, as shown below:

In main, only resource and webapp are available. Of course, some users may create the file for the first time. The file format after creation may be as follows:

Note that the folder icons of the two images are slightly different. Of course, these are modified through configuration. The following describes how to correctly configure these files and create a complete folder.

Create a Java folder under main and click project Structure in the upper-right corner.

If jdk is not set after clicking, you can select the corresponding jdk in the project option list. It can be seen that there are projects, modules, libraries, facets, and artifact on the left, which are configured one by one.

Click modules. There are three options on the right: sources, path, and dependencies.

First, configure sources. Right-click java under main and select sources. Configure resources in the same way. As for webapp, configure the path and dependencies later, after you use maven to import the package, dependencies is automatically configured. If you want to add a local package, you can click the green plus sign in dependencies to add the package, this operation is rarely used when maven is used. It is only applicable to projects that do not use maven.

The next libraries does not require us to perform this operation. We will skip to facets directly. Here we will configure the webapp. If there is no faces, you can click the plus sign to configure it. If there is no faces, you don't have to worry about it.

After faces is created, you need to configure the web. in xml, we can see that the default webapp location is \ simpledemo \ web, which is not our own \ simpledemo \ webapp, therefore, this must be modified. Otherwise, it is very likely that we will be in the web. xml configuration is correct and does not work. Change the path above to our web. xml, change the path below to the webapp of our project, and click apply.

After the configuration is complete, you will find that the icon of the folder has been modified.

Now the basic configuration has been completed, and the next step is to configure the pom

 

Configure springMvc: Use idea to build a simple SSM framework: (2) Configure springMVC

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.