On Thu, 23 Aug 2001, Dmitri Colebatch wrote:

> Date: Thu, 23 Aug 2001 06:42:13 +1000
> From: Dmitri Colebatch <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> Subject: Re: multiple context paths pointing to the same doc base?
>
> On Wed, 22 Aug 2001, Vladimir Grishchenko wrote:
>
> > >
> > > One option you have is to put the classes that actually cache things into
> > > a common directory ($TOMCAT_HOME/lib or $CATALINA_HOME/lib).  Such classes
> > > are shared across web apps, so this should accomplish your goal of having
> > > a single cache.  They are loaded from a (common) parent class loader to
> > > the one for each web app.
>
> Wont this still result in one init() call per servlet per context?

Yes, but the second initialization can easily detect that the cache has
already been initialized.

>  The
> only think you'll gain is the use of static variables right?  Obviously
> these could be used to achieve the desired outcome, but you wouldn't get
> "one context with two paths"...?
>

Since the original objective was to share the cache, it seems to me that
one versus two contexts is not a big deal, right?

> > >
> >
> > I'm not using the latest servlet spec (2.3). Anyway, the simplest solutuion
> > will be to put all my classes
> > on the system classpath, this should  work. I have no jsp's and don't need
> > dynamic class
> > reloading in production, so I beleive it's perfectly legal in my case.
>
> you would be well advised to put it in a jar which you then place in
> tomcat's lib dir... that way its relatively easy to move your app.
>

In fact, this is critical to the sharing solution.  Eerything in Tomcat's
lib directory is shared -- everything in /WEB-INF/classes or /WEB-INF/lib
is not shared.

> cheers
> dim
>
>

Craig


Reply via email to