When I was studying, I learned that it was embarrassing to publish the project to Tomcat in Eclipse or myeclipse, and then actually deploy the project on the server, so I learned how to do it, so I took a note of how Tomcat published the project.
1 Copy the Web project file directly into the WebApps directory
This is the most common way, Tomcat's WebApps directory is the Tomcat default application directory, and when the server starts, it loads all applications under this directory. If you want to modify this default directory, you can modify the AppBase value in the host tag in the Server.xml file under Conf.
This method is actually the same as deploying the project in the IDE development environment.
The access path with this method is Http://localhost:8080/webname
2 Modify Server.xml File
Locate the host tag in the Server.xml file under Conf, and add the following code:
Path: is the root address of the access, indicating the path of access, can be customized, as in the above example, access to the application address is as follows: Http://localhost:8080/jfinal_demo;
Docbase: Represents the path of the application, Docbase can use absolute paths, or relative paths, relative paths relative to WebApps;
Reloadable: Indicates that the class package can be loaded automatically at run time under the classes and Lib folders. This property is usually set to true in the development phase to facilitate development, and should be set to false in the release phase to increase the access speed of the application;
See related documentation for additional properties.
3 Adding an XML configuration file under the Conf\catalina\localhost directory
Create a new file named Jfinal_demo.xml, and the file content is configured as follows:
1 <context path= "/jfinal_demo" docbase= "F:\work\jfinal_demo\WebRoot"
Catalina\localhost directory tomcat download down default is not, the first boot will be created automatically, or can be created manually;
The Path property can be removed from the configuration because the root path for accessing the project depends only on the name of the XML file, as in the above example, access to the application address is as follows: Http://localhost:8080/jfinal_demo;
The third approach is recommended because you do not need to modify the tomcat default configuration, have minimal intrusion on Tomcat, and if you want to Undeploy, delete the XML configuration file directly.
Several ways Tomcat deploys a Java Web project