Cainiao learning java web (ii) ----- tomcat architecture, server. xml

Source: Internet
Author: User

The Tomcat server is composed of a series of configurable components. The core component is the Catalina Servlet container, which is the top-level container of all other Tomcat components.

Tomcat server structure diagram:

Tomcat architecture diagram:



Workflow of tomcat components:



Tomcat Server processes an http request (refer to the tomcat architecture ):

Assume that the request from the customer is:
Http: /localhost: 8080/wsota/wsota_index.jsp

1) The request is sent to the local port 8080, which is obtained by Coyote HTTP/1.1 Connector
2) Connector submits the request to the Engine of the Service to process it, and waits for a response from the Engine.
3) The Engine obtains the request localhost/wsota/wsota_index.jsp, matching all the virtual Host hosts it owns.
4) The Engine matches the Host named localhost (the request is handed over to the Host even if the match fails, because the Host is defined as the default Host of the Engine)
5) the localhost obtains the request/wsota/wsota_index.jsp and matches all the Context
6) The Host matches the Context in the/wsota path. (if no match is found, submit the request to the Context with the path name "" for processing)
7) obtain the request/wsota_index.jsp from the Context of path = "/wsota" and find the corresponding servlet in its mapping table.
8) the Context matches the servlet whose url pattern is *. jsp, which corresponds to the JspServlet class.
9) construct the HttpServletRequest object and the HttpServletResponse object, and call the JspServlet doGet or doPost method as parameters.
10) Context returns the HttpServletResponse object after execution to the Host
11) The Host returns the HttpServletResponse object to the Engine.
12) the Engine returns the HttpServletResponse object to Connector
13) Connector returns the HttpServletResponse object to the client browser.


Server. xml: This file describes how to start tomcat.The file structure is as follows:
     
      
      
          
          
              
               
                  
                      
                       
                   
           
      
 

The following describes the meaning of each node and corresponding attribute in server. xml:


Related Article

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.