Two quick comments embedded.

On Wed, 29 Aug 2001, Rick Mann wrote:

> Date: Wed, 29 Aug 2001 15:40:52 -0700
> From: Rick Mann <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> Subject: Re: Extending Server.xml configurability (for
>     additionalclasspaths)
>
> on 8/29/01 3:23 PM, Rob S. at [EMAIL PROTECTED] wrote:
>
> > When I wrote the email, I wasn't implying that whatsoever, but I can see
> > quite clearly now how it could be taken.  Apologies for that implication...
>
> No worries; in fact, I really don't understand the mechanism. However, if it
> helps me, I'd like to understand it. Since then, I've read about the
> ClassLoader, SecurityManager, and System classes. I could experiment, but in
> what I've read, I not sure I can install a new ClassLoader/SecurityManager
> which will get used by all classes in my web app next time a class needs to
> be loaded. Is there a way to specify the ClassLoader used by a context?
>
> > Ok, let me get this straight now.  You're saying, "i want to point a web app
> > to a location to load jars and classes from."  That already exists.  You put
> > the jars in the WEB-INF/classes and lib directory.
>
> Understood.
>
> > Then the next thing is, "i want them to be visible to more than one web
> > app."  That already exists too.  You put them in $CATALINE_HOME/common/lib
> > and classes.
>
> Didn't realize that one, closer to what I want. In the meantime, that will
> probably solve my problem, however, it's not a general solution (see below).
>

This works, but it also gives access to these classes to Catalina's
internal class loader.  This is important for something like servlet.jar
(which has to be the same both inside and outside the container), but not
generally required for applications.

The canonical place to put shared things that are just for application use
is in a JAR file under $CATALNIA_HOME/lib, or in unpacked classes under
$CATALINA_HOME/classes.

> > What do you want that Tomcat isn't already giving you? =)
>
> I want to specify a subset of all installed contexts that have access. I
> don't want all installed contexts to have access, just the ones I specify.
>

That would definitely require adding additional class loaders to the
hierarchy provided by Catalina.

> Now, to avoid changing the spec, which I understand to be the Servlet 2.2
> spec, which also understand to specify the structure of the web.xml file, I
> propose adding the functionality to the Server.xml file, which I believe to
> be defined by the core developers. If this is not the case, well, it makes
> my request more difficult.
>

Well, I've got *one* piece of good news for this discussion -- it's not a
spec issue at all :-).

The only thing the Servlet Specification talks about is /WEB-INF/classes
and /WEB-INF/lib.  Any additional capability to support sharing classes
across web applications is (by definition) container specific and is not,
in fact, required to be present at all, in any form.  (In other words,
portable applications cannot rely on *anything* outside the web app.)

Since server.xml is a Tomcat thing and not a spec thing, it's definitely
relevant here.

> TIA,
>
> ------------------------------------------------------------
> Roderick Mann               rmann @ latencyzero.com.sansspam
>

Craig

Reply via email to