Since the previous projects were developed using MyEclipse, it is now time to switch to eclipse. However, the project was imported into eclipse and found that the project was not a Web project and could not be deployed to Tomcat. This problem has been solved now.
First, make sure that eclipse on your machine is a Java EE version, or that you have installed the WTP plugin
two. Close project first, and then modify the. project file under Eclipse Engineering:
in <natures > </natures> add
<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>
Join in the
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
< arguments>
</arguments>
</buildCommand>
<buildCommand>
<name> org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
Three. Open project, and then refresh the project, right-click->properties->project facets->modify Project in projects, select Java and dynamic Web Module
Configure the context Root and content Directory and the source path.
This will solve the problem.
Method Two:
In direct import
After the MyEclipse project file is imported into eclipse, you need to modify the. project file under the Introduction project directory in the workspace that you put in the project, and modify the following:
1. Create a new Web project in Eclipse to overwrite the. project file under the root directory in the same directory as the exported project.
2. Open the. project file of the imported project and modify the value in the middle of the test.
After that, the project project file is refreshed. Then, right-click Project-->properties--> Select Project Facets, tick dynamic Web module and Java, and tick tomcat in runtime.
Then go to the project directory and modify the Org.eclipse.wst.common.component within its. Settings directory.
Then refresh the project project file, delete the webcontent, and publish and run it in Tomcat.