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