One, Reason,
1, write Java program for some time, but very long useless eclipse. So it's not clear how a Web project written with Eclipse is deployed to Tomcat, and the following is a record of how the Web project on Eclipse was deployed to Tomcat on its own initiative;
II. Deployment Issues
1, there is a problem. How to deploy the site project in eclipse to Tomcat on its own initiative.
Web projects made in Eclipse, by default, do not support publishing projects to webserver, they are advertised to a folder in the workspace, so Tomcat cannot be launched externally to execute Web projects, just open the server in Eclipse. Ability to execute Web projects. So make changes to eclipse. Talents will do well in the project. Published to Tomcatserver, published to the WebApps folder on the server.
2. Eclipse will publish the Web project to the Wtpwebapps folder under Eclipse's. Metadata\.plugins\org.eclipse.wst.server.core\tmp0 folder by default:
Here we see the default path for Eclipse. Assuming that this default path is used, the Web project will be deployed to this default path, so it will not be deployed to the tomcat we want.
3, here we also see there are two paths. First of all, the use workspace metadata this path, the translation answer means that using the workspace as a Web project deployment of the road (do not change the installation of Tomcat), in fact, and deployed to the default path of the eclipse deployment, Suppose you want to visit this project to start Tomcatserver in Eclipse, or you won't be able to access it.
4, the third path. That is the use of Tomcat installation this path, which is also the deployment path we want, the following is the deployment path:
(1), configure Tomcat to eclipse:window-->preferences-->server-->runtime environment-->add---> Select the Tomcat version number---> select the Tomcat installation folder--->finish
(2), diagram:
(3), window-->show view----> Server after the server appears in eclipse:
(4), on the server, right-click to select "Open", or press F3 shortcut key in the blank, or double-click. Open a page such as the following:
(5), select "Use Tomcat Installation" at "Server Locations". You can clearly see that the default is "use Workspace metadata", which is the folder above. You can then write WebApps on the path of the deploy, for example, as seen in:
(6), after the change is complete. You can save it. Later projects will be published under Tomcat under the WebApps.
Attention:
&, in Eclipse, publishes Web projects in such a way that the Conf directory of the original server is partitioned into the backup directory, creating a new directory for itself as a Web project for configuring Eclipse advertisement. So you still want to write a Java Web project using MyEclipse
&, sometimes, under the server locations project, nothing is optional, you can delete the server first and join Tomcatserver again. Then right-click to open. You can change it.
Web projects in eclipse proactively deploy to tomcat themselves