Tomcat operation schematic diagram

 Suppose the request from the client is:

http://localhost:8080/wsota/wsota_index.jsp

1) The request is sent to the local port 8080 and is obtained by the Coyote HTTP/1.1 Connector listening there

2) The Connector passes the request to the Engine of the Service where it is located to process and wait for the response from Engine

3) Engine gets the request localhost/wsota/wsota_index.jsp, matching all virtual hosts it owns Host

4) Engine matches the Host named localhost (even if it doesn't match, submit the request to Deal with the Host, because the Host is defined as the default host of the Engine)

5) The localhost Host gets the request /wsota/wsota_index.jsp, matching all Contexts it has

6) The Host matches the Context with the path /wsota (if If there is no match, hand the request to the Context with the path name "" for processing)

7) The Context of path="/wsota" obtains the request /wsota_index.jsp, and finds the corresponding servlet in its mapping table

8) Context matches Go to the servlet whose URL PATTERN is *.jsp, corresponding to the JspServlet class

9) Construct HttpServletRequest object and HttpServletResponse object, call the doGet or doPost method of JspServlet as parameters

10) Context returns the HttpServletResponse object after execution to the Host

11) Host returns the HttpServletResponse object The object is returned to the Engine

12) The Engine returns the HttpServletResponse object to the Connector

13) The Connector returns the HttpServletResponse object to the client browser

Related Posts