Deploy the Web project as a war package in the Tomcat step

Source: Internet
Author: User

Deploy the Web project as a war package in the Tomcat step

1. Make your own project into a war package.

2. Copy the packaged war to the ${tomcat.home}/webapps project.

3. Open the Server.xml file in the ${tomcat.hom}/conf directory, locate the host node, and add it under the host node:

<context docbase="D:\Program files\apache software foundation\tomcat 6.0\webapps\products.war" Path=  "/products" reloadable="true"

 

docBase: Point to the path where the root of the project is located, as I have made the project into a war package, direct point to the war package (my project is named: Products).
path: is a virtual directory, which is set to "products", after you start Tomcat, you will access the relevant page of the project via Http://localhost:8080/Products.
reloadable: If set to "true", it means that when you modify a JSP file, you do not need to restart the server to achieve the synchronization of the page display.

It can be understood that the project under the docbase actual directory is mapped to the virtual project path under the ${tomcat.home}\webapps directory (the configuration here refers to the products project).

Maybe some people still do not understand what the war package is, in fact, your project under the Webroot folder content (not add webroot this folder) into a compressed package, suffix with the war, in fact, and RAR almost, but Tomcat to recognize the war.

Then why does the war bag tell the project to publish it?

1. Because all new folders are in the Webroot folder

2. All the pages are under the Webroot folder

3. All the backend code is compiled into a. class file, under Webroot \ Web-inf \ Classes

4. We are accustomed to put all the. jar packages under Webroot \ web-inf \ lib

With this, it's the equivalent of a project completely tested under Tomcat, which is the principle of releasing a project with a war package.

Deploy the Web project as a war package in the Tomcat step

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.