tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
Subject Re: Context elements question
Date Fri, 10 Jan 2003 21:49:35 GMT

On Fri, 10 Jan 2003, Charlie Toohey wrote:

> Date: Fri, 10 Jan 2003 12:53:45 -0800
> From: Charlie Toohey <>
> Reply-To: Tomcat Users List <>
> To:
> Subject: Context elements question
> per the Tomcat configuration documentation at
> "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."
> I have two questions about this statement:
> 1)
> I don't have a Context meeting this description and everything seems to work
> fine, so what are the ramifications of violating this ?

Consider a Tomcat install with context paths "/foo" and "/bar" defined,
but no root context, and a request comes in for "/baz/index.html".  Tomcat
won't have any context to pass this request to, so it will return an

If you did have a root webapp, this rquest would look in the "/baz"
subdirectory for the "index.html" file, or hand it to a servlet mapped to
"/baz/*", or whatever else you configured in the root webapp's web.xml.

> 2)
> If I were to follow this, and did not have an actual webapp with a
> zero-length string as the context path (meaning that I would not have
> anything valid to specify for docBase), would I then just create a dummy
> webapp in directory ROOT (or wherever) just so that I could comply with this ?

That would be fine ... in fact, that's one of the most common things to do
with the $CATALINA_HOME/webapps/ROOT directory.

> - Charlie


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message