Tomcat Architecture in detail (iii) the entire process of request and response processing

Source: Internet
Author: User

From the Tomcat Source Analysis (ii), it is known that a user's request will go through n-link processing, and finally reached the developer wrote the servlet, to the servlet is HttpServletRequest and HttpServletResponse, So it can be thought that this way is nothing more than the original socket package into the servlet used in the HttpServletRequest and httpservletresponse, but each link to complete the packaging function and the part is not the same, the information flow as shown:

The class diagram for request and response is as follows:

Org.apache.coyote.Request and Org.apache.coyote.Response are used internally by Tomcat and are not available to developer calls, and the class is final type. The following is a sequence diagram of a complete request to see the machining process from socket to org.apache.catalina.connector.Request:

From the visible, request parsing and processing process is not done in a method, but the flow of information in the process of gradual analysis, different levels of the processor to parse different levels of information, in the parsing process at the same time to do some judgment and interception work, such as when the discovery is to access web-inf resources, The error is returned directly to the client and so on.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Tomcat Architecture in detail (iii) the entire process of request and response processing

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.