The most important role of the Tomcat server is to act as a container for Java Web applications. Java Web applications are defined in the Java servlet specification as follows:
A Java Web application consists of a set of Servlets, HTML pages, classes, and other resources that can be bound. It can be run in a Web application container that implements the servlet specification from a variety of vendors.
What you can include in a Java Web app:
- Servlet
- Jsp
- Practical class
- Static documents, such as HTML, pictures, etc.
- Client class
- Describe Web application information (XML)
The Tomcat server is a servlet/jsp container and a container for Java Web applications. Because the main components that make up a Java Web application are Servlets and JSPs.
Each Java Web App has a unique context. When the Java Web is running, the servlet creates a unique ServletContext object for each Web application that is shared by all components in the same Web application.
Assume that two web apps are shopping and bookstore, and two customers access the following URLs, respectively:
The URL for customer 1 access is: http://localhost:8080/shopping/index.html
The URL for customer 2 access is: http://localhost:8080/bookstore/bookstore.jsp
The access process is as follows:
Tossing and turning are just a few components:
Top-level server;
Below is the service, where a service in a server can have multiple;
Then the connector and engine, each service has only one engine,engine processing the service in which all connector received the request;
There can be multiple hosts in an engine, each host can contain one or more web apps, and each Web app has its own context.
What do Java Web apps include?