The process by which Tomcat server processes an HTTP request
1, the user click on the content of the page, the request was sent to the native port 8080, was there to listen to the Coyote http/1.1 connector obtained.
2. Connector the request to the engine of the service it is working on, and waits for the engine to respond.
3, the engine obtains the request localhost/test/index.jsp, matches all the virtual host hosts.
4. The engine matches the host named localhost (even if it does not match the request to the host processing, because the host is defined as the engine's default host), host named localhost gets the request/test/ index.jsp, matching all of the context it owns. The host matches to the context where the path is/test (if the match is not matched, the request is given to the context where the path name "" is processed).
5, path= "/test" the context to obtain the request/index.jsp, in its mapping table to find out the corresponding servlet. The context matches to a servlet with a URL pattern of *.jsp, corresponding to the Jspservlet class.
6, constructs the HttpServletRequest object and the HttpServletResponse object, calls the Jspservlet doget () or dopost () as a parameter. Executes the business logic, data storage, and other programs.
7. The context returns the HttpServletResponse object after execution to host.
8. The host returns the HttpServletResponse object to the engine.
9, Engine put HttpServletResponse object back to connector.
10, connector the HttpServletResponse object back to the customer browser.
<Server>//top-level class element that can include multiple service<Service>//Top class element, can contain one engine, multiple connecter<Connector>//Connector class element, representing the communication interface<Engine>//Container class element that handles customer requests for a specific service component, including multiple host<Host>//Container class element that handles customer requests for a specific virtual host component and can contain multiple context<Context>//Container class element to process all customer requests for a specific Web application</Context> </Host> </Engine> </Connector> </Service></Server>
Original Blog Address: http://www.cnblogs.com/zhouyuqin/p/5143121.html
The TOMCAT server process for processing an HTTP request (GO)