"Tomcat" hierarchy

Source: Internet
Author: User
Tags tomcat server
The Tomcat server is composed of a series of configurable components, where the core component is the Catalina servlet container, which is the top-level container for all other tomcat components. The hierarchical relationships that exist between Tomcat components are shown in Figure 1-2.

The "expert tip" Tomcat component can be configured in the <tomcat_home>\conf\server.xml file, where each Tomcat component corresponds to a configuration element in the server. xml file.

In the code of the XML file, the relationships between these components are as follows:

Each of these components divides Tomcat into layers (server, service, engine, host, context), and each layer interacts through a data pipeline pipeline, as shown in Figure 1-3.

The above layers of corresponding components and their role in the Tomcat server are as follows:

(1) Server layer

The corresponding server component logically represents the entire tomcat, the entire Catalina servlet container. It is at the top level of Tomcat and can contain one or more service layers. Tomcat provides a default implementation of this layer interface, so it is not usually necessary for the user to implement it themselves.

(2) Service layer

The corresponding service component is a logical functional layer that is contained in the server layer. It contains a engine layer, and one or more connectors (Connector). The service component binds one or more connector components to the engine layer, connector the component listening ports, obtains user requests, and sends the request to the engine layer, while sending the processing results to the user to achieve a specific practical function. Tomcat provides a default implementation of the service interface, so there is usually no need for user customization.

(3) Engine layer

Corresponds to the engine component, which is a request distribution processing layer that can connect multiple connector. It receives the request from Connector, resolves the URL that can complete the user request, according to this URL can match the request to the correct host, when the host processing completes the user request, the engine layer returns the result to the suitable connector, then transmits to the user by the connector. The interface of this layer generally does not require the user to customize, in particular, the user can implement the interface to provide a custom engine.

(4) Host layer

Corresponding to the host component, which represents a virtual host, a engine layer can contain multiple host tiers, each host layer can contain one or more context layers, corresponding to different Web applications. Because the implementation of the host interface (class Standardhost) provided by Tomcat provides important additional functionality, users typically do not need to customize the host.

(5) Context layer

Corresponds to the context component, which represents the actual directory on a virtual host or a war, a single Web application that runs on a particular virtual host and is used most frequently. A host layer contains multiple context layers, each of which has a unique path, and the host layer, upon request, navigates the request to the context layer based on the URL requested by the user.

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.