You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Gabriel J Zimmerman <ga...@groundzero.com> on 2001/08/21 23:25:42 UTC

Imaginative webapp setup. Is this possible to do?

I have a server that has many virtual hosts, say
http://www.myhost1.com/, http://www.myhost2.com, http://www.myhost3.com
etc. etc.

Is it possible to create a webapp that is hosted at the / level for each
of these hosts, where the servlets,tag libraries, and java classes
located in the WEB-INF section would all be the same but where the docs
and JSP files would be unique for each host? 

By unique, I mean that each host would have its own html files, JSP
files, image files etc., which would not be accessable from the other
hosts.

Thanks,

Gabe Zimmerman

Re: Imaginative webapp setup. Is this possible to do?

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Thu, 23 Aug 2001, Jeff Turner wrote:

> Date: Thu, 23 Aug 2001 19:13:21 +1000
> From: Jeff Turner <je...@socialchange.net.au>
> Reply-To: tomcat-user@jakarta.apache.org
> To: tomcat-user@jakarta.apache.org
> Subject: Re: Imaginative webapp setup. Is this possible to do?
>
> On Thu, Aug 23, 2001 at 12:43:49AM -0500, Brandon Cruz wrote:
> > Thank you, but I've been told that...
> >
> > >"In Tomcat 3.x, the class loader follows the usual "delegate upwards then
> > >look locally" approach, so that the class would be loaded from
> > >tomcat_home/lib unconditionally.
> > >
> > >In Tomcat 4.x, the underlying servlet spec gives web apps the option (it
> > >is not a requirement) to look in the local repositories (/WEB-INF/classes
> > >and /WEB-INF/lib/*.jar)  *first*, before delegating upwards, and Tomcat
> > >4.0 implements this feature."
> >
> > You say in 3.3 I can accomplish the same thing as in tomcat4 though?  That
> > would be very nice!
>
> That sounds like Craig or some similarly clueful person, so I'd say
> they're right ;)

Yep. :-)  I'm at least somewhat clueful -- except about 3.3 about which I
know very little of the internals.

> Only external goals like spec conformance could force
> such a patently braindead scheme in an open source project.
>

Just out of curiosity, which scheme do you consider brain-dead?

> > Brandon
> >
> > P.S.  My 3.2.1 does have and use $tomcat_home/classes, should it not?
>
> Does it work? ;) If so, cool..
>
> --Jeff
>

Craig



Re: Imaginative webapp setup. Is this possible to do?

Posted by Jeff Turner <je...@socialchange.net.au>.
On Thu, Aug 23, 2001 at 12:43:49AM -0500, Brandon Cruz wrote:
> Thank you, but I've been told that...
> 
> >"In Tomcat 3.x, the class loader follows the usual "delegate upwards then
> >look locally" approach, so that the class would be loaded from
> >tomcat_home/lib unconditionally.
> >
> >In Tomcat 4.x, the underlying servlet spec gives web apps the option (it
> >is not a requirement) to look in the local repositories (/WEB-INF/classes
> >and /WEB-INF/lib/*.jar)  *first*, before delegating upwards, and Tomcat
> >4.0 implements this feature."
> 
> You say in 3.3 I can accomplish the same thing as in tomcat4 though?  That
> would be very nice!

That sounds like Craig or some similarly clueful person, so I'd say
they're right ;) Only external goals like spec conformance could force
such a patently braindead scheme in an open source project.

> Brandon
> 
> P.S.  My 3.2.1 does have and use $tomcat_home/classes, should it not?

Does it work? ;) If so, cool..

--Jeff

RE: Imaginative webapp setup. Is this possible to do?

Posted by Brandon Cruz <bc...@norvax.com>.
Thank you, but I've been told that...

>"In Tomcat 3.x, the class loader follows the usual "delegate upwards then
>look locally" approach, so that the class would be loaded from
>tomcat_home/lib unconditionally.
>
>In Tomcat 4.x, the underlying servlet spec gives web apps the option (it
>is not a requirement) to look in the local repositories (/WEB-INF/classes
>and /WEB-INF/lib/*.jar)  *first*, before delegating upwards, and Tomcat
>4.0 implements this feature."

You say in 3.3 I can accomplish the same thing as in tomcat4 though?  That
would be very nice!



Brandon

P.S.  My 3.2.1 does have and use $tomcat_home/classes, should it not?

-----Original Message-----
From: Jeff Turner [mailto:jeff@socialchange.net.au]
Sent: Wednesday, August 22, 2001 11:57 PM
To: tomcat-user@jakarta.apache.org
Subject: Re: Imaginative webapp setup. Is this possible to do?


On Wed, Aug 22, 2001 at 09:58:33AM -0500, Brandon Cruz wrote:
> So...if you can put all common class files into tomcat_home/classes, can
we
> put newer versions of the same class files into the new applications
> web-inf/classes and assume that they will be read first by the web
> application?  Or...can we put the old versions of the jar files into the
old
> applications web-inf/lib and assume those will be read first

No, in 3.2.x the $TOMCAT_HOME/lib always takes precedence over
WEB-INF/lib and WEB-INF/classes.

> I am using tomcat 3.2.1 with many vhosts and they all use one set of
classes
> and jar files right now, located in tomcat_home/classes and
tomcat_home/lib.

I didn't know there was a $TOMCAT_HOME/classes.. only $TOMCAT_HOME/lib.

> I want to update many of these classes for newer vhosts, but don't want it
> to change for the old applications using them.

Yep, you're out of luck. Upgrade to 3.3 or 4.0 if you want WEB-INF/* to
override $TOMCAT_HOME/*

--Jeff

> Brandon



Re: Imaginative webapp setup. Is this possible to do?

Posted by Jeff Turner <je...@socialchange.net.au>.
On Wed, Aug 22, 2001 at 09:58:33AM -0500, Brandon Cruz wrote:
> So...if you can put all common class files into tomcat_home/classes, can we
> put newer versions of the same class files into the new applications
> web-inf/classes and assume that they will be read first by the web
> application?  Or...can we put the old versions of the jar files into the old
> applications web-inf/lib and assume those will be read first

No, in 3.2.x the $TOMCAT_HOME/lib always takes precedence over
WEB-INF/lib and WEB-INF/classes.

> I am using tomcat 3.2.1 with many vhosts and they all use one set of classes
> and jar files right now, located in tomcat_home/classes and tomcat_home/lib.

I didn't know there was a $TOMCAT_HOME/classes.. only $TOMCAT_HOME/lib.

> I want to update many of these classes for newer vhosts, but don't want it
> to change for the old applications using them.

Yep, you're out of luck. Upgrade to 3.3 or 4.0 if you want WEB-INF/* to
override $TOMCAT_HOME/*

--Jeff

> Brandon

RE: Imaginative webapp setup. Is this possible to do?

Posted by Brandon Cruz <bc...@norvax.com>.
So...if you can put all common class files into tomcat_home/classes, can we
put newer versions of the same class files into the new applications
web-inf/classes and assume that they will be read first by the web
application?  Or...can we put the old versions of the jar files into the old
applications web-inf/lib and assume those will be read first

I am using tomcat 3.2.1 with many vhosts and they all use one set of classes
and jar files right now, located in tomcat_home/classes and tomcat_home/lib.
I want to update many of these classes for newer vhosts, but don't want it
to change for the old applications using them.



Brandon

-----Original Message-----
From: Jeff Turner [mailto:jeff@socialchange.net.au]
Sent: Tuesday, August 21, 2001 6:55 PM
To: tomcat-user@jakarta.apache.org
Subject: Re: Imaginative webapp setup. Is this possible to do?


On Tue, Aug 21, 2001 at 05:25:42PM -0400, Gabriel J Zimmerman wrote:
> I have a server that has many virtual hosts, say
> http://www.myhost1.com/, http://www.myhost2.com, http://www.myhost3.com
> etc. etc.

Yer.. once did a site with 36 of these. It wasn't pleasant ;)

> Is it possible to create a webapp that is hosted at the / level for each
> of these hosts, where the servlets,tag libraries, and java classes
> located in the WEB-INF section would all be the same but where the docs
> and JSP files would be unique for each host?

You can put your common classes into $TOMCAT_HOME/lib (or whatever it is
for 3.3 and 4.0). Taglib jars can go there, but the XML definition files
will have to be duplicated in the WEB-INFs.

>
> By unique, I mean that each host would have its own html files, JSP
> files, image files etc., which would not be accessable from the other
> hosts.

Yep. Logically they're still separate webapps.

--Jeff

>
> Thanks,
>
> Gabe Zimmerman



Re: Imaginative webapp setup. Is this possible to do?

Posted by Jeff Turner <je...@socialchange.net.au>.
On Tue, Aug 21, 2001 at 05:25:42PM -0400, Gabriel J Zimmerman wrote:
> I have a server that has many virtual hosts, say
> http://www.myhost1.com/, http://www.myhost2.com, http://www.myhost3.com
> etc. etc.

Yer.. once did a site with 36 of these. It wasn't pleasant ;)

> Is it possible to create a webapp that is hosted at the / level for each
> of these hosts, where the servlets,tag libraries, and java classes
> located in the WEB-INF section would all be the same but where the docs
> and JSP files would be unique for each host? 

You can put your common classes into $TOMCAT_HOME/lib (or whatever it is
for 3.3 and 4.0). Taglib jars can go there, but the XML definition files
will have to be duplicated in the WEB-INFs.

> 
> By unique, I mean that each host would have its own html files, JSP
> files, image files etc., which would not be accessable from the other
> hosts.

Yep. Logically they're still separate webapps.

--Jeff

> 
> Thanks,
> 
> Gabe Zimmerman