Converting java project into Tomcat project

Time:2020-11-22

The first step

Download eclipse and install the Tomcat plug-in.

Step two

Converting java project into Tomcat project

In the top menu bar, selectFile->New->Java Project, create a new Java project.

Step three

Converting java project into Tomcat project

After the project is established, select the projectRight click > Properties > Tomcat

  • Is a Tomcat ProjectTick it
  • Context nameIf you do not fill in the access path, it will be the root directory
  • Subdiretory to set ass web application root (optional)fill in/web

Step 4

Converting java project into Tomcat project
Build in projectwebFolder, create it under the folderlibWEB-INFTwo folders andindex.htmlA page and.

PS: Well, it was a mistake,libbelongWEB-INFTable of contents.

Step five

Converting java project into Tomcat project
Select projectRight click > Properties > java build path, inSourceTabDefault ouput folder, fill intest/web/WEB-INF/classes

Step 6

Converting java project into Tomcat project

In the top menu bar, selectWindow->Preferences->Tomcat, based on your own version of Tomcat.

stayWindow->Preferences->Tomcat->Source PathIn the middleAutomatically compute source pathTick it.

Step 7

Right click the itemTomcat Project->Update context definition

Step 8

Click the kitten start Tomcat to see the effect.

Converting java project into Tomcat project