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