From c9d331202ed6c3566386c64b64f02c4804e402d7 Mon Sep 17 00:00:00 2001
From: markt
You may define as many Context elements as you
- wish. Each such Context MUST have a unique
- context path, which is defined by the path attribute.
- In addition, you MUST define a Context with a context path equal to
+ wish. Each such Context MUST have a unique context path. In
+ addition, a Context must be present with a context path equal to
a zero-length string. This Context becomes the default
web application for this virtual host, and is used to process all
requests that do not match any other Context's context path.
In addition to nesting Context elements inside a - Host element, you can also store them:
+For Tomcat 6, unlike Tomcat 4.x, it is NOT recommended to place
+ <Context> elements directly in the server.xml file. This
+ is because it makes modifing the Context configuration
+ more invasive since the main conf/server.xml file cannot be
+ reloaded without restarting Tomcat.
Context elements may be explicitly defined:
$CATALINA_HOME/conf/context.xml file:
+ $CATALINA_HOME/conf/context.xml file:
the Context element information will be loaded by all webapps$CATALINA_HOME/conf/[enginename]/[hostname]/context.xml.default
file: the Context element information will be loaded by all webapps of that
host$CATALINA_HOME/conf/[enginename]/[hostname]/ directory/META-INF/context.xml inside the application files$CATALINA_HOME/conf/[enginename]/[hostname]/ directory.
+ The name of the file (less the .xml) extension will be used as the
+ context path. Multi-level context paths may be defined using #, e.g.
+ context#path.xml. The default web application may be defined
+ by using a file called ROOT.xml./META-INF/context.xml inside the application filesconf/server.xmlSee
- Automatic
- Application Deployment for more information. This method allows dynamic
- reconfiguration of the web application, since the main
- conf/server.xml file cannot be reloaded without restarting
- Tomcat. Please note that for tomcat 6, unlike tomcat 4.x, it is NOT
- recommended to place <Context> elements directly in the server.xml file.
- Instead, put them in the META-INF/context.xml directory of your WAR file or
- the conf directory as described above.
In addition to explicitly specified Context elements, there are -- 2.11.0