Original reference: Http://www.educity.cn/wenda/147993.html
http://blog.163.com/java_zf/blog/static/19926038420129240314546/
Tomcat Deployment Web project (Eclipse Auto-Deploy project to Tomcat, access URL does not contain deployment name)
recent projects need to deploy the project to Tomcat, and the access path does not include the unsigned, and want to implement the automatic deployment of eclipse, grilled a long time data, finally realized their own needs, hehe, as follows:
1. Set the project context root to/:
Right-click the project to make the following changes
2. In Eclipse, remove the project under the server first, then right-click the server to select Clear up, and then double-tap the server to modify the deployment path (modifying the deployment path must be the only way you can find your own deployment path)
3. In the Tomcat installation directory, there is a conf folder, open this folder, which contains the configuration file Server.xml, open the configuration file, and insert the following statement between
<context path= "/hello" docbase= "F:\eclipse3.2\workspace\hello\WebRoot" debug= "0" privileged= "true" $AMP; >amp; $nbsp; </Context>
Modify the Server.xml to suit your needs
Web project with Tomcat published in Eclipse, changing its deployment path
My Eclipse working directory:
D:\eclipse\workspace
When you are finished configuring Tomcat in Eclipse, the path that you publish to is:
D:\eclipse\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps
This path is too deep, so I want to use the default path of Tomcat, how do I make changes in eclipse?
1. Locate the server panel and right-click on the current Tomcat and remove all of the works first.
2. Then right-click the Tomcat, select Clean, and clear.
3. Double-clicking the Tomcat will open the properties panel and find the second server Locations on the left.
Selecting the second will create a new Wtpwebapps file under the Tomcat path to hold the Tomcat published Web project;
Select the third one, you can enter the path you want in the server path, save it.
Eclipse deployment Tomcat modifies project Access path (virtual path)