part 1: Tomcat structure

part 1: Tomcat structure

Author: chSkyrainhtml

l  Tomcat web

A servlet container in JSWDKT(Java Server Web Development kit)tomcat

l  Servlet Advantageapp

Ø  Access and store all resources(local or network)jvm

Ø  Servlet control the features of accessingui

Ø  Servlet can be activated from local or remote networkspa

Ø  Servlet can be embedded into html page with 「Servlet Tag」code

Ø  By 「link」 tech ,one servlet can call another servlet as its clientcomponent

Ø  Cross protocolorm

 

l  Relation between Servlet and tomcat

Ø  Servlet container/Servlet Engine

Decode MIME request & Format MIME response

Ø  Servlet container working mode( all are supported by tomcat ):

a)      Run alone

Tomcat ‘s default mode

b)     Built-in

Web server plug-in + Java container(jvm)

c)      Built-out

IPC

l  Layer structure of Tomcat

A series of configure-able components

Ø  Core: Catalina Servlet Container (the top container for all other components)

Ø  Layers relationship:

Server/

-Service/

-Connector

-Engine

-Host

-Context

                   

        [!]: all components can be configured in file 「<TOMCAT_HOME>/conf/server.xml」

[!]: all components communicate with each other through 「Pipeline

 

(1)   Server:

i)                   The whole catalina servlet container

ii)                 Top level

iii)               Contain one or more service

(2)   Service

i)                   Logic & functions

ii)                 One engine + some connectors

iii)               Connectors listen to some ports and get requests ,then pass to Engine to handler

(3)   Connector

(4)   Engine

i)                   Dispense and handle requests

ii)                 Connect to more than one connectors

iii)               Process:

Connector got a request

->(Map)parse URL to match the right Host

->(Host)handle request

->return result to suitable Connector

->response user

(5)   Host

i)                   Virtual hosts

ii)                 Each host contain more than one context layers, which corresponding to different web apps;

iii)               Interface Class: StandardHost

(6)   Context

i)                   Corresponding to an existing directory or WAR( a single web application)

l  Java Web

Ø  Standard definition by SUN:

「Java web applications are composed of a set of Servlets, HTM pages, Classes, and other resources that can be bound」

Ø  An Java Web App <--> an unique Context

相關文章
相關標籤/搜索