The process by which Tomcat server processes an HTTP request

Source: Internet
Author: User

Suppose the request from the customer is:

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

1) The request is sent to the native port 8080, where the Coyote http/1.1 connector that is listening is obtained
2) connector the request to the engine of the service it is working on and waits for a response from the engine
3) The engine obtains the request localhost/wsota/wsota_index.jsp, matches all the virtual host hosts it owns
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)
5) localhost host gets the request/wsota/wsota_index.jsp, matching all the context it owns
6) host matches to the context where the path is/wsota (if the match is not matched, the request is given to the context of the path named "" to process)
7) path= "/wsota" The context gets the request/wsota_index.jsp, in its mapping table to find the corresponding servlet
8) context matches to a servlet with a URL pattern of *.jsp, corresponding to the Jspservlet class
9) constructs the HttpServletRequest object and the HttpServletResponse object, calling Jspservlet's Doget or Dopost method as a parameter
) context returns the HttpServletResponse object to host after it has finished executing
) host returns the HttpServletResponse object to the engine
) engine returns the HttpServletResponse object to connector
Connector return the HttpServletResponse object to the customer browser

Original address: http://yut-i.blog.163.com/blog/static/2425778220121159347221/

The process by which Tomcat server processes an HTTP request

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.