In eclipse, convert a Java project into a web project

Source: Internet
Author: User

Convert a common Eclipse project into a web project

 

1. Edit the. project file of the project.

  1. Add 1
  2. <Nature> org. Eclipse. WST. Common. Project. facet. Core. Nature </nature>
  3. To
  4. <Natures>
  5. ...
  6. </Natures>

2. refresh the project, right-click Project-> properties-> Project facets, and select Java, JavaScript (not required), and dynamic Web module3. if your project source code folder is not the default SRC of WTP, add the corresponding source code folder to the Java build path. 4. If your project web folder is not the default webcontent of WTP, You need to modify the file. Open the file: <project directory>/. Settings/org. Eclipse. WST. Common. component, and find
  1. <WB-resource deploy-Path = "/" Source-Path = "/webcontent"/>

And modify, as shown in figure

  1. <WB-resource deploy-Path = "/" Source-Path = "/webapp"/>

 

 

Of course, for large projects, the most convenient thing is to install the Tomcat plug-in, and then configure the Tomcat server. XML as follows:

  1. <Host name = "localhost" appbase = "webapps"
  2. Unpackwars = "true" autodeploy = "true"
  3. Xmlvalidation = "false" xmlnamespaceaware = "false">
  4. <Context Path = "" docbase = "E: \ workspaces \ doone \ Mondrian \ webapp" DEBUG = "0" reloadable = "true"/>
  5. </Host>

  6. Structure of WTP
  7. <Context docbase = "Mondrian" Path = "/Mondrian"
  8. Reloadable = "true" Source = "org. Eclipse. JST. J2EE. SERVER: Mondrian"/>

From: http://qq85609655.iteye.com/blog/752319
Related Article

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.