There are several ways to deploy a Java Web application in tomcat:
#PetWeb是工程名1. In the host node of the Tomcat_home\conf\server.xml file, add
<context docbase= "F:/workspaces/petweb" reloadable= "false" path= "/pet"/>
where reloadable= "false" means that the server does not automatically load after the content in the application is changed, and this property is usually set to true during the development phase, which is easy to develop, and should be set to false in the release phase to increase the access speed of the application. Docbase is a path, you can use an absolute path, or you can use a relative path relative to the WebApps. The value of the Path property is the root address of the access. The access address is as follows: http://localhost:8080/Pet/
2. Add an XML file in Tomcat_home\conf\catalina\localhost, such as Pet.xml, as follows:
<context docbase= "F:/workspaces/petweb" reloadable= "false"/>
You may find that the second approach is the same, but the path attribute is missing, and the server uses the name of the. Xml as the value of the Path property. The access address is as follows: http://localhost:8080/Pet/
3. In the Tomcat_home\conf\server.xml file, add a host node, you can copy the localhost name of the host node, the host node Name property to another name, and then the tomcat_home\conf\ Catalina Create a folder named the name of the new host node, and then create a root.xml file in the folder with the following contents:
<context docbase= "F:/workspaces/petweb" reloadable= "false" path= "/pet"/>
PS:when configuring the Path property of the context, the paths that need to be configured cannot be in Chinese and Tomcat does not support
Reference article:
http://blog.163.com/ribbonchen/blog/static/118316505201071510386736/
How to deploy Java Web applications in tomcat