What is the overall architecture of Tomcat?
This article mainly explains "what is the overall structure of Tomcat". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn how the overall architecture of Tomcat is.
Overall architecture
If we want to understand a framework, we first need to understand what it does. Tomcat, as we all know, is used to handle connected Socket requests. Then Tomcat will have two functions:
Handle the connection externally and convert the received byte stream into the Request and Response objects you want
Process Servlet internally and distribute the corresponding Request request to the corresponding Servlet
Then our overall skeleton comes out, and the Tomcat is actually divided into two parts, one is that the Connnector handles external connections and the other is that the Container manages the internal Servelet. The general diagram is as follows
The outermost large box represents a Tomcat service, and a Tomcat service can correspond to multiple Service. Each Service has connectors and containers. We can also open these corresponding relationships and see them in server.xml in the Tomcat directory configuration file.