Tomcat Container Model principle

Source: Internet
Author: User

Tomcat is a core project of the Apache Software Foundation (Apache Software Foundation) Jakarta Project, developed by Apache, Sun, and other companies and individuals. With Sun's involvement and support, the latest servlet and JSP specifications are always reflected in Tomcat, and Tomcat 5 supports the latest servlet 2.4 and JSP 2.0 specifications. Because Tomcat technology advanced, stable performance, and free, so deeply loved by Java enthusiasts and has been recognized by some software developers, become the most popular Web application server.

Tomcat server is a free open source Web application server, belongs to the lightweight application server, in small and medium-sized systems and concurrent access users are not widely used, is the first choice to develop and debug JSP programs. For a beginner, it can be thought that when the Apache server is configured on a single machine, it can respond to requests for access to the HTML (one application under the standard Universal Markup Language) page. The tomcat part is actually an extension of the Apache server, but it runs independently, so when you run Tomcat, it actually runs separately as a separate process from Apache.

Tomcat is organized into a series of logical modules that mainly include:

    • Core architecture modules: such as server,service,engine,host and context and wrapper
    • Network Interface Module Connector
    • Session Management Module
    • Jasper Module
    • Naming module
    • JMX Module
    • Rights control Module

Tomcat's container is divided into four tiers, and the container that really manages the servlet is the context container, a context that corresponds to a WEB project

In the container hierarchy of Tomcat, the context container is a container for directly managing the wrapper class wrapper (Standardwrapper) of the servlet in the container, so how the context container runs will directly affect the way the servlet works.

Servlet wrapper class: Standardwrapper, here's a question, why would you want to wrap the servlet as a standardwrapper instead of being a servlet object directly? Because Standardwrapper is part of the Tomcat container, it has the characteristics of the container, and the Servlet is a standalone web development standard that should not be strongly coupled in Tomcat.

In addition to wrapping the servlet into a standardwrapper and adding it as a child container to the context, all the other Web. XML properties are parsed into the context, so that the context container is the servlet that really runs the servlet Container. A WEB application corresponds to a Context container, and the configuration properties of the container are specified by the application's Web. XML, so that we can understand what web. XML does.

Tomcat Container Model principle

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.