Convert a common Eclipse project into a web project
1. Edit the. project file of the project.
- Add 1
- <Nature> org. Eclipse. WST. Common. Project. facet. Core. Nature </nature>
- To
- <Natures>
- ...
- </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
- <WB-resource deploy-Path = "/" Source-Path = "/webcontent"/>
And modify, as shown in figure
- <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:
- <Host name = "localhost" appbase = "webapps"
- Unpackwars = "true" autodeploy = "true"
- Xmlvalidation = "false" xmlnamespaceaware = "false">
- <Context Path = "" docbase = "E: \ workspaces \ doone \ Mondrian \ webapp" DEBUG = "0" reloadable = "true"/>
- </Host>
- Structure of WTP
- <Context docbase = "Mondrian" Path = "/Mondrian"
- Reloadable = "true" Source = "org. Eclipse. JST. J2EE. SERVER: Mondrian"/>
From: http://qq85609655.iteye.com/blog/752319