Tomcat project deployment method: tomcat project deployment

Source: Internet
Author: User

Tomcat project deployment method: tomcat project deployment

Method 1:
In the Conf directory of Tomcat, add the following to the <Host/> node in Server. Xml:

<Context Path="/Hello"Docbase="D:\Users\WebProject\WebContent" Debug="0" Privileged="True" Reloadable="True"></Context>

The Reloadable = "true" attribute indicates that files are automatically loaded when there is a change, that is, hot loading. In large web projects, we recommend that you do not use hot loading, which will greatly degrade system performance.

Method 2: copy the Web project file "You can also copy the generated war" to the Webapps directory.

Method 3: flexible. In the Conf directory, create a new Catalina (case sensitive)/Localhost directory and create an Xml file in the directory. The name can be retrieved at will, the content of the Xml file is as follows:

<?xml version="1.0" encoding="UTF-8"?><Context docBase="D:\Users\WebProject\WebContent">        <WatchedResource>WEB-INF/web.xml</WatchedResource></Context>

The third method is to generate the preceding XML file in the conf \ catalina \ localhost directory of Tomcat after the Web application is loaded. You can manually create the xml file, point to the web project of your workspace.

<Context path="/admin" docBase="${catalina.home}/server/webapps/admin" debug="0" privileged="true"></Context>

The 3rd methods have the advantage of defining aliases. The project running on the server is named web1, and the file name of web2 is used for external access URLs. This method can easily hide the project name. Some Project names are fixed and cannot be changed. However, it is very effective to change the path for external access.

By the way, the mainstream Java IDE, Eclipse, and IDEA all support built-in Tom, which is very convenient for starting and debugging web projects.

In my opinion, the built-in startup Tom is faster than the built-in Tom in IDE. Applications started in external Tomcat in the LAN can be accessed by others, and the built-in Tom cannot.

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.