Java Web Learning Series-create a Web project using Maven under MyEclipse for Spring, myeclipsemaven

Source: Internet
Author: User

Java Web Learning Series-create a Web project using Maven under MyEclipse for Spring, myeclipsemaven
Create a Maven Web Project

Create a Maven project in Eclipse

Select the project type and select maven-archetype-webapp from Artifact Id.

Enter the Group ID, Artifact ID, and Package. Generally, the Group ID is the name of a large project. The Artifact ID is the name of a sub-project, and the Package is a Package for you by default.

The file structure is as follows:

Added the src/test/java Directory, which is mainly used to compile the server test code.

Through the above steps, a basic Maven Web project structure is created.

Project troubleshooting

The index. jsp file created by default in the project reports The following error: the superclass "javax. servlet. http. HttpServlet" was not found on The Java Build Path

Right-click the web Project-> property or Build Path-> Java Build Path-> Libraries-> Add Libray...

Select MyEclipse Server Library

Select the corresponding version of Tomcat Runtime Library

Return to Order and Export on the Java Build Path interface and check the configured Tomcat Runtime Library to solve the above error.

Maven Web project compilation release test

Compile this project

 

After executing the Maven install compilation command, a corresponding file will be generated, and any one of the red boxes can be published using Tomcat,

Access the deployed project and output the content of the page normally.

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.