http://blog.csdn.net/lynn_wgr/article/details/7751228
Create a new dynamic Web Project in Eclipse. After writing the code, select Run on server (of course server is configured as Tomcat), but after the run we send the name of the project we created under the Tomcat installation directory. Obviously, the project is not automatically deployed to Tomcat's WebApps.
Don't believe us wait for Tomcat in eclipse to start later. Enter http://localhost:8080/webDemo/login.jsp (where Webdemo is the project name) in the eclipse's built-in browser. can open normally. But we did not have the desired kitten screen when we opened http://localhost:8080 on the external browser. In other words, Toncat does not start properly. (often we are in the Bin directory after clicking Startup.bat.) You can see the desired kitten in the input http://localhost:8080.)
In order for our project to be automatically deployed to the WebApps directory like Myelipse (plugins can be used, but the eclipse plugin doesn't seem to work well, I don't like it anyway). We need to make some simple changes to the Tomcat server we've built.
1: Stop the Tomcat server in Eclipse. Stop
2: Delete items in run on server before
3: Select the Tomcat server below servers. Right click and select Open, the following prompt appears:
Modify the server Locations (the default is the first one selected.) If there is no 1, 2-step operation. This option is grayed out and cannot be edited)
Select the second item (Use Tomcat installation (takes ...)
4: Change the following deploy path to WebApps, the default is Wptwebapps, the above server path corresponds to the Tomcat installation directory on the computer
5: Save Settings. Exit
6: Click Web Project, run as--and run on Server--.....
Then. The project is automatically deployed under Tomcat's WebApps. After startup, you can browse normally.
Note that there is a change to the Server.xml file in the tomcat--conf directory (eclipse automatically modifies it. Note the modified content <context ......>
Tomcat boots up normally, 404. Eclipse does not deploy the project correctly