Tomcat Publish Project Conf/catalina/localhost configuration and data source configuration

Source: Internet
Author: User

This article describes publishing a project by adding a configuration file under the Conf/catalina/localhost directory in Tomcat. Because this is the least invasive of Tomcat, you only need to add a new configuration file, do not have to modify the original configuration, and support dynamic parsing, modify the code directly into effect (except for the modification of the configuration).

Create an XML file under the Conf\catalina\localhost directory of the Tomcat server with the following content:

or case:

Get.xml:


<!--data Source configuration--
<resource type= "xxx" maxactive= "xxx" maxidle= "xxx" maxwait= "xxx" username= "xxx" password= "xxx" driverclassname= "xxx" url= "xxx"/>
</Context>

Path refers to the project's publishing path, which is the access path, which you need to access: IP: Port/get (for example: Http://localhost:8080/get)
Docbase refers to the project's publishing path
Note: The file name of the XML must be consistent with the publishing path (path)! In this example, the XML file name must be: get



This allows you to publish the project to the docbase= "/part2/upload/" directory and then access the file through the path= "/" Configuration plus the XML name

Tomcat Publish Project Conf/catalina/localhost configuration and data source configuration

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.