When using eclipse to develop a web project, I use the Tomcat plug-in. This is the case when deploying a web project:
On the project, right-click-> properties-> tomcat-> and check the is a tomcat project to write the context name and web application root.
Note the following two points:
1. The context name is the name after http: // localhost: 8080. Remember to add/
2. Web application root is in the same directory as SRC, which contains the name of the folder for WEB-INF and META-INF, eclipse default is webroot.
However, when I started Tomcat and started running the project following this deployment, http: // localhost: 8080 showed the cat, and no exception was reported during startup, however, when accessing the project, the system reports a 404 error (generally the path is incorrect due to the 404 error). No project-compiled XML file exists in conf-> Catalina-> localhost of Tomcat, I can't explain it. It's exactly like this ..
After several hours of exploration, the solution is as follows:
Right-click the project-> properties-> JAVA build path-> source. Here is a default Output Folder, which should be set:
Project name/Web application root/WEB-INF/classes
Only in this way can the Eclipse project be successfully deployed on Tomcat.