The structure and element parameters of Tomcat

Source: Internet
Author: User
Tags java web tomcat tomcat server
the element structure of Tomcat
1. Tomcat consists of a series of configurable components, the core of which is the servlet container component, which is the top-level container for all other Tomcat components, and 2, each component of Tomcat can be in the <catalina_home>/conf/ Server.xml "file, each Tomcat component corresponds to a configuration element in Server.xml, the following is a typical structure of a server.xml:
1
<Server>
2
<Service>
3
<connector/>
4
<Engine>
5
<Host>
6
<Context>
7
</Context>
8
</Host>
9
</Engine>
10
</Service>
11
</Server>
The elements in the configuration file can be divided into the following 4 categories: 1) Top class elements: including <Server><Service>;<server>: Represents the entire servlet container component, which is the top-level element of Tomcat and can contain one or more <Service>;
<service&gt: Contains a <Engine> and one or more <connector&gt, and these <Connector> share a <Engine>;
2) Connector class element: for <Connector>;<connector&gt: Represents a communication interface between the client and the server, responsible for sending the client's request to the server and returning the server's response to the customer;
3) Container class elements: 4 classes <Engine><Host><Context><Cluster>&LT;ENGINE&GT: Handle all <Connector> received customer requests from the same <Servcie>;
<context&gt: The most frequently used element, each <Context> represents a single Web application running on a virtual host, and a <Host> can contain multiple <Context>;
4) Nested class containerRepresents components that can be embedded in a container, such as <Value> and <Realm>;

Tomcat's directory structureThe following is a subdirectory of the Tomcat installation directory that will feature
/bin Store startup and shutdown Tomcat control scripts
/conf Store tomcat various configuration files, which are more commonly used by server.xml
/lib
Jar files that are accessible to both the Tomcat server and all Web applications
/logs Log files that hold Tomcat
/webapps When publishing a Javaweb program on Tomcat, the Web application is stored in this directory by default
/work Tomcat's working directory, Tomcat stores some of the runtime's working files in this directory, as by default, Tomcat stores JSP-compiled Servelet class files in this directory
A typical Java Web application directory structure (stored in the WebApps root directory, assuming the project name is DemoApp) 1
/webapps
2
|--demoapp
3
4
|--mypackage
5
|--dispatcherservlet.java
6
|--hellotag.java
7
|--web-inf
8
|--web.xml
9
|--mytaglib
10
|--classes
11
|--mypackage
12
|--dispatcherservlet.class
13
|--hellotag.class
14

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.