Tomcat Server Principles

Source: Internet
Author: User

Constitute:

1.server represents the entire Catalina Serverlet container

2.service: Consists of one or more connector and a shared engine processing engines

3.connector listens for customer requests on the specified port and gives the request to engine processing (Coyote HTTP and coyoteJK2)

4.Engine must be configured under Service components, the Engine can be configured with multiple virtual hosts.

5.host represents a virtual host, one or more Web applications under each virtual host, one context for each Web application, and one context path

6.context loading servlets based on $catalina_home/conf/web.xml and $webapp/web-inf/web.xml at creation time

Loading device:

How to place class and resource files
A. Corresponds to a Web application: class is placed under the web-inf/classes under the Web application under the jar under Web-inf/lib

B. Corresponds to multiple Web applications: class is placed in the $catalina_home/shared/class directory.

The Tomcat class is loaded (ClassLoader):
Bootstrap ($JAVA _home/jre/lib/ext/*.jar)
System ($CLASSPATH/*.class and the specified jar)
Common (classes,lib,endores three sub-directories under $CATALINA _home/common)
Catalina (Classes and Lib directories under $CATALINA _home/server/are only visible to Tomcat)
& Shared (the classes and Lib directories under $CATALINA _home/shared/, and $catalina_home/lib directories) are visible only to Web applications and are not visible to Tomcat
WEBAPP ($WEBAPP/web-inf/* only visible classes/*.class Lib/*.jar for this Web app)


For web apps, the order in which classes and resources are loaded is:

/web-inf/classes-->/web-inf/lib/*.jar-->bootstrap-->system-$CATALINA _home/common/classes
-$CATALINA _home/common/endores/*.jar-$CATALINA _home/common/lib/*.jar-$CATALINA _home/shared/ Classes
-$CATALINA _home/shared/lib/*.jar

Tomcat Server Principles

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.