StandardContext
Catalina主要包括Connector和Container,StandardContext就是一个Container,它主要负责对进入的用户请求进行处理。实际来说,不是由它来进行处理,而是交给内部的valve处理。
一个context表示了一个外部应用,它包含多个wrapper,每个wrapper表示一个servlet定义。
/**
* Standard implementation of the <b>Context</b> interface. Each
* child container must be a Wrapper implementation to process the
* requests directed to a particular servlet.
*
* @author Craig R. McClanahan
* @author Remy Maucherat
* @version $Revision: 1.112 $ $Date: 2002/09/09 14:39:37 $
*/
public class StandardContext
extends ContainerBase
implements Context {
// ----------------------------------------------------------- Constructors
/**
* Create a new StandardContext component with the default basic Valve.
*/
public StandardContext() {
super();
pipeline.setBasic(new StandardContextValve());
namingResources.setContainer(this);
}
StandardContext主要成员
/**
* The application available flag for this Context.
*/
private boolean available = false;
/**
* The "correctly configured" flag for this Context.
* context是否已经正确设置完成
*/
private boolean configured = false;
/**
* The document root for this web application.
*/
private String docBase = null;
/**
* The set of filter definitions for this application, keyed by
* filter name.
* 过滤器定义
*/
private HashMap filterDefs = new HashMap();
/**
* The set of filter mappings for this application, in the order
* they were defined in the deployment descriptor.
* 过滤器匹配
*/
private FilterMap filterMaps[] = new FilterMap[0];
/**
* The login configuration descriptor for this web application.
* 登陆权限验证
*/
private LoginConfig loginConfig = null;
/**
* The Java class name of the default Mapper class for this Container.
*/
private String mapperClass =
"org.apache.catalina.core.StandardContextMapper";
/**
* The security role mappings for this application, keyed by role
* name (as used within the application).
* 角色匹配。权限验证用到
*/
private HashMap roleMappings = new HashMap();
/**
* The servlet mappings for this web application, keyed by
* matching pattern.
* servlet匹配。用于根据url等匹配对应servlet
*/
private HashMap servletMappings = new<