Explain the deployment path issue (. metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps) for the Tomcat project under Eclipse

Source: Internet
Author: User

Configure the development environment for Eclipse, configure the JDK installation path and the Tomcat installation path. Build Dynamic Web Project Project Zhgy under Eclipse, and when you launch the Dynamic Web project by launching this Tomcat with new Tomcat in Eclipse, the project is not actually published to Tomcat The installation directory is located under the WebApps. This can be viewed in the WebApps directory of the Tomcat installation directory described above. From the console output at startup time, the project is published to the following directory:

Info: Set Web App root system property: ' webapp.root ' = [D:\workSpace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0 \wtpwebapps\zhgy\]

Open this directory to see clearly that there is a folder such as Zhgy, this is the project directory we can now access.

Then open D:\workSpace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\ This directory, you can see the structure of this directory and D:\Tomcat 6.0 directory structure is identical, Just a few more Wtpwebapps directories. In fact D:\workSpace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\ This directory is the eclipse of the D:\Tomcat 6.0 directory of a clone, so that D:\ The workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\ is also capable of having source server capabilities.

If the new server, the D:\workSpace\.metadata\.plugins\org.eclipse.wst.server.core\ directory will appear in sequence temp0, Temp1, TEMP2 and other clone servers, But there is only one clone server that can be started at a time, because they all use the same boot port (and, of course, the same shutdown port, etc.).

This will bring us a lot of inconvenience. For example: As far as the above project is concerned, when we are in the process of development, the project needs to put the uploaded images into the upload folder of the project's sibling directory, it will find that the image is uploaded to the directory D:\workSpace\.metadata\.plugins\ Org.eclipse.wst.server.core\tmp0\wtpwebapps\upload\, but the uploaded picture cannot be accessed in the browser. At this point we can manually copy the upload directory to the D:\workSpace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\webapps\, In this case, it is really accessible in the browser. This behavior is caused by the fact that the Tomcat server defaults to WebApps as the project directory, not the Wtpwebapps directory. The D:\workSpace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\zhgy\ can be accessed through the browser through the Zhgy project, is due to the fact that Eclipse released the project through Tomcat in D:\workSpace-jx\.metadata\.plugins\org.eclipse.wst.server.core\tmp3\conf The Server.xml file in the directory has the following settings:

[HTML]View PlainCopy
    1. <Context docbase="D:\workSpace\.metadata\.plugins\org.eclipse.wst.server.core\tmp3\wtpwebapps\ Zhgy "
    2. Path="/zhgy" reloadable="true" source="org.eclipse.jst.jee.server:zhgy"/>

This can be understood by looking at the new Tomcat property in Eclipse, as shown in server locations:

Manual copying can solve the problem, but it is inconvenient. However, the server locations in is gray and cannot be changed. In fact, Eclipse new Tomcat clone can be changed, but in the new Tomcat do not add any project in, and then click on Tomcat right button open:

You can see that the server locations option is no longer grayed out and can be edited:

Here are three options to choose from:

1. Use Eclipse's workspace, as the example above is D:\workSpace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\

2. Use the Tomcat installation directory, as the example above is D:\tomcat\

3. Customize the path, here is your own choice of directory

You can also define which directory the project is deployed to in the container by modifying the deploy path. For example, we can choose use Tomcat installtion this way, and set the Deploy path to WebApps:

In fact, the simplest way is to modify the-dwtp.deploy property of the VM arguments. The property location is: VM Arguments, Arguments, run configurations, Eclipse menu bar run.

Source: http://kingxss.iteye.com/blog/1741438

Explain the deployment path issue (. metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps) for the Tomcat project under Eclipse

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.