Context initialization and startup
So far, we've seen how a web application's resources may be retrieved, how a brand new Tomcat-specific protocol to access these resources is defined, and how Tomcat implements its own class loader. Rest assured that the hard part is over, and it's all going to be coasting downhill from here.
Our focus now shifts to starting up the context, its children, and other nested components.
As we have seen in the last chapter, a HostConfig
instance deploys the web applications associated with its host. For instance, its deployDescriptors()
method enumerates the context fragments that it finds in the CATALINA_BASE/conf/Catalina/localhost
folder, deploying each in turn.
Each context fragment is deployed to a context path that is based on the name of that context fragment file. This path is computed by stripping off the extension (.xml
), replacing any '#' characters by forward slashes and prefixing the final path by a leading forward slash. A context fragment named ROOT...