Tomcat的容器用来装载Servlet。那Tomcat的Servlet容器是如何设计的呢?

 

容器的层次结构

Tomcat设计了4种容器:Engine、Host、Context和Wrapper

Tomcat通过这种分层,使得Servlet容器具有很好的灵活性。