Eclipse+maven Creating a WebApp Project

Source: Internet
Author: User

1. Open Eclipse, right-click new--"Other, if you find Maven project,

Select Maven Project , Click Next




2. After selecting Maven project, display the window for creating MAVEN projects, tick Create a simple project , and then next



3. Enter the basic information for the MAVEN project as shown in:




4, back to the project structure, the project structure is relatively clear, in line with the MAVEN project we want to create



5. Since our project is going to use eclipse to post to Tomcat, here we need to first turn the project into Dynamic Web project

Select items, right-click Properties , go to the Properties page,

Select to the Maven menu Project Facets , Click Convert to faceted form ... , as follows: as shown in the following:




6. Tick The Dynamic Web Module Click further configuration available ...


After clicking



7. Change the webcontent to Src/main/webapp, and tick the option to generate Web. XML, as follows:



8, complete the configuration as above, the final completion of the MAVEN WEBAPP project structure as shown:




9. Create a simple JSP initial page under WebApp index.jsp
<%@ page language= "java" contenttype= "text/html; Charset=utf-8 "    pageencoding=" UTF-8 "%><! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd" >


10. Deploy the test project to Tomcat to test the http://localhost:8080/test results:
OK, you can easily build a Web project with Mawen.

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.