The process by which Tomcat server processes an HTTP request

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.