Configure Tomcat on Eclipse, publish Web Project A, where is the location of the published file

Source: Internet
Author: User
Tags tomcat server

Configure Tomcat on Eclipse, publish Web Project A, where is the location of the published file

========================================

The following are only personal opinions, for reference only

such as: A Project: D:\javaeclipse\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp7\wtpwebapps\A
Description: (1) D:\javaeclipse\workspace\ is Eclipse's current workspace,. Metadata is the eclipse-generated directory that represents the current D:\javaeclipse\workspace ECLIPCE is the working space.
(2). Metadata\.plugins is the Eclipse plug-in directory, Tomcat is added to eclipse in the form of plug-ins, so Eclipse's Tomcat directory is not a true Tomcat installation root directory, But in the Eclipse workspace. Metadata\.plugins\org.eclipse.wst.server.core
(3) As for TMP7, that is when eclipse new a Tomcat server, it will create a tmp1,2 server under the core TMP1 and tmp2 ... And so on, I built 7 tomcat servers, so there would be TMP7, and my A would be deployed under this TMP7. The TMP7 here represents a temporary tomcat (the directory structure inside is a bit like the directory structure under the Tomcat installation path, which can be understood as a Tomcat replica, I guess TMP is a temporary meaning.) )
(4) Wtpwebapps, typically, when we deploy the project with Tomcat manually, there are 2 different release locations for the project: 1 refers to the path of the specified WebApp in the configuration file in Conf, which is the Web engineering path, from development to deployment using files from the same directory, without copying or packaging The 2nd is to pack the Web project into a war package and copy it to the {Tomcat_home}/webapps directory, Tomcat automatically recognizes the war package, extracts the war package, gets a Web project, and generates the relevant JSP files into the D:\javaeclipse\ Workspace\apache-tomcat-6.0.37\work\catalina\localhost (note that under localhost is only web files, not all engineering files, all files should go to WebApps), There's a problem with the release of this way, is to change the project to repackage and put the new war package under WebApps, even if you just modify a JSP file on a text or identifier, but also to regenerate the war package to publish (war includes a change suffix to the RAR to see the contents, but, Modifying the file inside and changing it back to the war suffix does not seem to be identified by Tomcat, which is not known until it is tested.
And here the Wtpwebapps, should be equivalent to the actual Tomcat WebApps directory, Wtpwebapps in a equivalent to WebApps under the A.war generated a project, should be saved to generate a war package copy to the WebApps directory operation.
In other words, the project's release file is in the tomcat-wtpwebapps\a of this webapps\a or eclipse configuration. The browser requests access to write a folder rather than the real engineering files in the workspace workspace under our eclipse.

This explains why eclipse modifies a jsp/js or Java file in the Web project before it compiles (building, there is no release engineering eclipse will recompile the project, nothing to do with Tomcat, This is Eclipse's self-test feature, and then publish to Tomcat on the eclipse configuration, that is, publish to Wtpwebapps.
(If Eclipse does not configure Tomcat, but publishes a manually, then after Eclise finishes building, we will regenerate the war package to overwrite the principle old war package under Tomcat_home\webapps, Tomcat will monitor the war package changes and republish the Web project before the browser can request a new JSP or servlet. Of course, if the use of tomcat_home\conf\server.xml configuration of the way to release, it is more convenient, eclise modified, building completed, Tomcat will automatically redistribute this project A. A typical Web application server, such as the Tomcat JBoss resin, should have the function of automatically republishing the project. )

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.