A more plump servlet Web server with Conector, Processor, Bootstrap (2 code Analysis)

Source: Internet
Author: User

Code Analysis:

Class Relationship:

Bootstrap main program is responsible for server startup, control HttpConnector components;

The HttpConnector class is responsible for HTTP links and thread management, and controls httpprocessor components;

The Httpprocessor class is responsible for parsing the HTTP protocol and creating the Res/req, and the other classes under the same package are the related classes that are decoupled for the parsing req, in order to get the related classes of the writer, and the request object properties in this application to nearly complete resolution, respon It seems that se can only use writer to set the response header by the programmer itself? The book does not make a statement, you see the code can not be from the static relationship? Staticresourceprocessor processing static resource classes did not change, Servletprocessor load class has not done much of the evolution is still dynamic loading servlet components.

Object relationships:

Httpprocessor is responsible for parsing HTTP information, such as Requestline,requestheader, while Requestparameter is still implicitly performing the parameter parsing process when the programmer acquires Paramater.

The most frustrating thing in the program is the properties of the response object, does the res have some default or header information that the server should automatically set before handing it over to the servlet programmer? Or are they all assigned to the programmer? Very crazy, res code also did not see Sanlai, although in Httpprocessor Sethearder, but still can not thoroughly understand the author's intention.

       

A more plump servlet Web server with Conector, Processor, Bootstrap (2 code Analysis)

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.