A
Host is a Container that represents a virtual host in the Catalina servlet engine. It is useful in the following types of scenarios:
- You wish to use Interceptors that see every single request processed by this particular virtual host.
- You wish to run Catalina in with a standalone HTTP connector, but still want support for multiple virtual hosts.
The parent Container attached to a Host is generally an Engine, but may be some other implementation, or may be omitted if it is not necessary.
The child containers attached to a Host are generally implementations of Context (representing an individual servlet context).
代表一个Virtual Host,虚拟主机,每个虚拟主机和某个网络域名Domain Name相匹配
每个虚拟主机下都可以部署(deploy)一个或者多个Web App,每个Web App对应于一个Context,有一个Context path
当Host获得一个请求时,将把该请求匹配到某个Context上,然后把该请求交给该Context来处理匹配的方法是“最长匹配”,所以一个path==""的Context将成为该Host的默认Context 所有无法和其它Context的路径名匹配的请求都将最终和该默认Context匹配