The Servlet Container and Web Applications
At Agent startup, the servlet container loads, initializes, and deploys the servlets so they are ready and waiting for requests. When a request arrives, it enters the Agent through the connectors, which pass it to the default http handler chain, then to the servlet handler, and finally to the servlet container. The container translates the request into C++ objects and passes it to the proper servlet. The servlet processes the request and returns a response to the handler chain, which passes it back up to the Agent’s connectors and back to the requestor.
The servlet container is designed to perform well while serving large numbers of requests. A container can hold any number of active servlets, filters, listeners, or named objects. Both the container and the objects in it are multithreaded. The servlet container creates and manages threads as necessary to handle incoming requests. The container handles multiple requests concurrently, and more than one thread may enter an object at a time. Therefore, each object within a servlet container must be threadsafe.
Figure 1 presents a diagram of a running container. In the diagram, the servlet container has a single network connector. The container manages two contexts, each of which contains a number of objects.
Figure 1 – The servlet container diagram