Current location - Quotes Website - Collection of slogans - What is the operation process of java web project +tomcat service, such as how to deploy to the server, and how does tomcat find java projects?
What is the operation process of java web project +tomcat service, such as how to deploy to the server, and how does tomcat find java projects?
Tomcat is a web container, and a java web project is equivalent to an element in the container. When a java web project is deployed to the server, it is equivalent to adding an element to the container.

When tomcat is started, the tomcat container will get information about the internal elements, such as the name of the web project.

When a user requests a server, he first finds the tomcat container you started according to the requested first-level domain name. The container intercepts the requested project name after parsing the request character behind the first-level domain name, and sends the request information to the web project corresponding to the project name in the container according to the project name. Then, the web project processes the request, sends the response information to the container and returns it to the user.

In more detail.

Why does the request find an open tomcat server?

First, the address you requested is the ip address of this machine, so that the request can be sent to this machine. So how to give this machine tomcat focuses on the port. According to the port information of all open programs in this machine, the request will be given to the corresponding programs.

The default port of tomcat is 8080, so you need to add: 8080 in the request address. Of course, you can change the port of tomcat, such as 80, so you don't need to add: 8080 to the request address, because the ports within 100 will automatically match.