Reference: http://blog.csdn.net/yerenyuan_pku/article/details/51830104
First click on window and then preferences
Then click Add to select the version of Tomcat
Choose a good tomcat path and JRE
Then create a Dynamic Web Project
That context root can be said to be the name of the contexts that content directory is the name of the folder where the Web files are placed
Now we can say that we've got Tomcat in eclipse, and then we're going to deploy the Web app to Tomcat.
Let the tomcat server appear on the console first:
Window->showview->servers
Click on that line for no servers, then follow the prompts to add the dynamic project we just built. Then try to run and test with http://localhost:8080/.
And then you'll report 404 errors.
This is because, we double-click this server, we will find that the location of the server is workplace default, that is, our normal working space. This means that there is no such project under Tomcat WebApp, and we know that the Web project should be placed under Tomcat's WebApp to run successfully. So we have to change it now, but we can't change it.
Now all we have to do is remove all the projects that are deployed under the server (that is, the project under the WebApps of the Tomcat installation path)
, and then right-click on the server, select Clean,clean, and then double-click the server to enter the configuration to discover that the configuration can be modified.
Then just 1. Change location to Tomcat 2. Change the deploy path to WebApps and save!
And then test it again and get it done!
Configure Tomcat in Eclipse and deploy the project to Tomcat