tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
Subject Re: classreloading and 4.x
Date Thu, 04 Jan 2001 17:41:45 GMT
Rolf Veen wrote:

> Hi (feliz año nuevo).
> Craig R. McClanahan wrote:
> > First, your web.xml file defines the root webapp like so:
> >     <Context path="" docBase="scarab" reloadable="true">
> >         <Loader checkInterval="3"
> >          className="org.apache.catalina.loader.StandardLoader"/>
> >     </Context>
> > so Catalina initializes a nice webapp for you, including reloading support.
> >
> > Next, Catalina finds a directory named "scarab" under the "webapps" directory,
> > so it auto-deploys *another* context for the same document root, with a context
> > path of "/scarab".  By default reloadable is set to false, so this webapp has it
> > turned off.
> >
> Maybe a stupid question:

Not a stupid question at all.

> Isn't it possible to recognize these two contexts as being the same ?

The problem is in deciding what the criteria is for "same-ness".

Normally, you set up Tomcat so that the directory name (within "webapps") is the same
as the context path (minus the leading "/"), so that a directory named "scarab" would
be auto-deployed on context path "/scarab".  There is a special case for the root
webapp (context path ""), which is recognized in a directory named "ROOT" because
zero-length directory names are frowned upon by both platforms.

In the case of the example above, the <Context> entry breaks this usual convention,
because it uses a different context path than the directory name.  (And none of this
is new to 4.0 -- check the TOMCAT-USER archives for questions about "my application
was deployed twice" or "my servlet was initialized three times" and you will see what
I mean.)

We can certainly decide that the "$CATALINA_HOME/webapps/scarab" directory has already
been deployed under *some* context path, and not deploy it again.  But that means you
would not be allowed to deploy the same directory under two context paths, even if you
wanted to -- which might be something a sysadmin wants to do under some circumstances
(especially if you're embedded inside a J2EE server that uses JNDI contexts to provide
customized references to JDBC data sources or EJBs).

What do folks think?  If we're going to change this historical behavior of Tomcat,
doing so at a major version number change is *much* better than doing it any other

> >
> > Craig
> >
> Rolf.


View raw message