Objective:
When you use eclipse to develop your project, importing a Web project into eclipse will become a Java project , you will not be able to run the deployment in Tomcat.
Method:
1. Locate the . Project file and find the <natures> tag inside to see if there is any code below, and then copy it IN.
XML code
- < nature > Org.eclipse.wst.common.project.facet.core.nature</ nature >
- < nature > Org.eclipse.wst.common.modulecore.modulecorenature</ nature >
- < Nature >org.eclipse.jem.workbench.JavaEMFNature</nature>
note: There is only one sentence in the Java project:
XML code
- < Nature >org.eclipse.jdt.core.javanature</nature>
2. Refresh the imported project
3. Right-click on the project, go to Properties configuration, Click Project Facets, then click Convert to Faceted form to enter the property settings:
4. Tick the dynamic WEB module and java, Select the appropriate version, and click on the further configuration available that appears below:
5. Modify Eclipse default webcontent to webroot, and tick generate Web. XML deployment Deor according to your needs:
5. Click Ok-->apply App settings, and the Java project is converted for the web Project.
note: If you forget to click further configuration available, that is, forget to modify WebContent to Webroot,
You can click the Deployment Assembly option , then delete the webcontent and add the Webroot .
Icon:
Create or Import:
Modified In:
Modification Completed:
Run in Tomcat:
Note:
The steps for creating a new Web project are the same, except That:
To set Webroot, you can only set it in further configuration available .
cannot be set in deployment assembly .
How to convert a Java project into a Web project in eclipse