(i) Construction of the SPRINGMVC project

Source: Internet
Author: User

The project is built under Eclipse, and the following steps are given to build it:

Step 1: Create a MAVEN project

  

Step 2: Choose Workspace, where the source code is stored

  

Step 3: Choose the structure of the project (skeleton), MAVEN has prepared a lot of common project structure for us, because it is a Web project, so

Selected the Maven-archetype-webapp

  

Step 4: Edit GroupID and Artifactid, the meanings of these two IDs are as follows:

GroupID and Artifactid are collectively referred to as "coordinates" in order to ensure the uniqueness of the project, if you want to get your project to the MAVEN local repository, you want to find your project must be based on these two ID to find.
GroupID generally divided into several paragraphs, here I only say two paragraphs, the first paragraph is the domain, the second paragraph is the company name. Domain is also divided into org, COM, CN and so many, including Org is not a profit organization, COM for business organizations. Example of an Apache Tomcat project: The project's GroupID is Org.apache, its domain is org (because Tomcat is a nonprofit project), and the company name is Apache,artigactid Tomcat.
For example, I create a project, I will generally set the GroupID to CN.SNOWIN,CN for China, Snowin is my personal initials, Artifactid is set to Testproj, indicating that your project name is testproj, according to this setting, your package structure is preferably cn.zr.testProj hit Head, if there is a Studentdao, its full path is Cn.snowin.testProj.dao.StudentDao

  

The structure of the completed project is created as follows:

    

Can see the project JSP error, the contents of the error is as follows:

  

Now to explain the cause of the error, because the JSP full name is JavaServer Pages,jsp, like a servlet, is executed on the server side. The implementation of the JSP requires the support of the servlet, and Java's own jar package does not have a servlet jar package, so the additional jar package needs to be introduced.

Java build path is an external reference to the Java project, such as an additional jar package, you can add additional referenced jar packages to it at any time, so we follow the procedure to introduce the missing jar package

  

Introducing JAR Packages

  

This explains why adding the server runtime to the library solves the problem of missing servlet jar packages. Because there are a lot of APIs that are provided by the server, we don't have to add jars separately in Eclipse,

When we add the server runtime, it will automatically import many jar files under this server directory.

    

After completing the above steps, the basic spring MVC is built.

  

(i) Construction of the SPRINGMVC project

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.