According to the Tomcat 5.5 Docs ( http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/context.html):
-------------------------------------------------------------------------------------------------------- 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 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. The value of the path field must not be set except when statically defining a Context in server.xml In addition to nesting Context elements inside a Host element, you can also store them: - in the individual $CATALINA_HOME/conf/context.xml file: the Context element information will be loaded by all webapps - in the individual $CATALINA_HOME/conf/[enginename]/[hostname]/context.xml.default file: the Context element information will be loaded by all webapps of that host - in individual files (with a ".xml" extension) in the $CATALINA_HOME/conf/[enginename]/[hostname]/ directory - if the previous file was not found for this application, in individual file at /META-INF/context.xml inside the application files Finally, note that if you are defining contexts explicitly, you should probably turn off automatic application deployment. Otherwise, your context will be deployed twice each, and that may cause problems for your app. ----------------------------------------------------------------------- Now, I want to define a context with docbase of "/decweb", which will be the default web application (in particular, respond to all requests to the root of the webserver). So I put in my server.xml <Context docBase="/decweb" path="" />. I also set autodeploy=false in my host element. However for some reason I have to restart my server twice after deployment for the webapp to work and I don't know why. When I deploy and then start my server and then go to the root of the webserver in my browser, I get a directory listing (decweb, decweb.war). Even if I click on /decweb, the application malfunctions (can't explain in more detail, but some servlets/scripts don't run). Then I restart the webserver and it works. Why? Should I also have a context.xml in my webapps META-INF directory with <Context docBase="/decweb" /> ? I tried that and it didn't help. Thanks, Regards, John Fletcher This disclaimer certifies that this message has been scanned by Centrelink's Anti-virus system. If this e-mail is found to have a virus attached by any other Anti-virus system, this does not mean that Centrelink are responsible in any way. ********************************************************************** IMPORTANT: This e-mail is intended for the use of the addressee and may contain information that is confidential, commercially valuable or subject to legal or parliamentary privilege. If you are not the intended recipient you are notified that any review, re-transmission, disclosure, use or dissemination of this communication is strictly prohibited by several Commonwealth Acts of Parliament. If you have received this communication in error please notify the sender immediately and delete all copies of this transmission together with any attachments. **********************************************************************