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)