tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject RE: webapps
Date Mon, 08 Oct 2001 22:00:04 GMT


On Mon, 8 Oct 2001, Josh Knowles wrote:

> Date: Mon, 8 Oct 2001 13:58:55 -0700
> From: Josh Knowles <Josh.Knowles@worldwidepackets.com>
> Reply-To: tomcat-user@jakarta.apache.org
> To: "'tomcat-user@jakarta.apache.org'" <tomcat-user@jakarta.apache.org>
> Subject: RE: webapps
>
> Ok that makes sense for a virtual host or isp type environment but is there
> ever a reason that you would do it for a single host running one site?
>

In many environments, the functionality of a complete site is the result
of the work of several development groups.  Partitioning into multiple web
apps lets you install, operate, and upgrade those pieces of functionality
totally independently of each other, versus having to integrate everything
into a single webapp (which is what really happens when you just use the
ROOT one).

This approach also avoids some potential cases were one app might
(unknowningly) interfere with the opeartion of another.  Consider some
cases:

* One app depends on version "x" of a clas, another app needs
  version "y" (no problem with separate class loaders).

* Classes uses by one app might use a static variable to share
  information with other classes in that app.  If the same such
  static is used in two webapps, they won't interfere with each
  other.

* Two apps try to use the same session attribute name (each app
  has its own completely independent set of sessions).

* Two apps try to use the same servlet context attribute name
  (each app has its own servlet context also).

Bottom line -- it's all about protecting you from yourself :-).

Of course, for a really small site (or app) with only a few pages and
associated classes, maintained by a single person, these reasons probably
aren't compelling enough to bother you.  But you asked for the general
case, and there are *lots* of examples where it is crucially important for
the kinds of reasons outlined above.

> Thanks,
>
> ~j
>

Craig McClanahan


> -----Original Message-----
> From: Craig Tataryn [mailto:news@computer-programmer.org]
> Sent: Monday, October 08, 2001 2:00 PM
> To: tomcat-user@jakarta.apache.org
> Subject: Re: webapps
>
>
> Hi Josh.  One good reason is that with some servlet containers you can
> just deploy web applications without bothering anyone else who is using
> the Servlet container.  Another good reason is that you automatically
> get your own class loader.  This comes in handy for when you want to use
> component vX.x and somebody else is using the servlet container is using
> component vY.y.  If you deployed your servlets "the old fashion way",
> both of you would have to use vX.x or vY.y whereas with webapps, you can
> just use the version of the component you want to use for your web
> application.
>
> Hope that makes sense (and I hope I got it right),
>
> <tataryn:craig/>
>
> Josh Knowles wrote:
>
> >I am trying to understand the usage behind the different webapps but I
> still
> >haven't found a good reason as to why you would want more then just the
> >"root" webapp.  Can someone either give me a better explanation of them or
> >point me to a location where I can find one.
> >
> >Thanks,
> >
> >~josh
> >
>
>


Mime
View raw message