There was a period of time when the project was not deployed to tomcat, and there were 404 problems with deployment today.
1. Environment
tomcat7 jdk1.7 eclipse-jee-luna-R-win32
2. Problem description
1. When creating the web project, create a tomcat server in eclilpse, add the web project to the server, and start the server in eclipse, and the startup is successful. Enter in the browser: http://localhost:8080, the page appears 404, as shown in the figure
2. Even if no items are added under the tomcat, start tomcat in eclipse (start is successful). Enter: http://localhost:8080 in the browser, and the 404 error in the above picture also appears
3. Close the tomcat in eclipse, start the locally installed tomcat, and enter: http://localhost:8080 in the browser to access the tomcat page normally.
3. Solution
1. Delete the project deployed under the tomcat
2. Reconfigure tomcat. Double-click the created server and you will see the following interface
3. Change the selection of the first red mark to: Use Tomcat installation (takes control of Tomcat installation)
If there are projects under tomcat, the configuration file of tomcat cannot be changed. You just need to remove the projects deployed under tomcat.
4. Change the second red-marked Deploy path to the directory where the tomcat publishes the project: webapps
5. Save the changes, restart tomcat, and enter again in the browser: http://localhost:8080 You will see the familiar tomcat page.
The above is the solution to the 404 problem that occurs when deploying tomcat. I hope it will be helpful to everyone.