tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
Subject Re: Splitting up a web app?
Date Fri, 01 Sep 2000 17:22:38 GMT
Richard Evans wrote:

> We have an existing web directory structure which has web pages in one place
> (shared amongst several web apps), and servlet classes in a couple of other
> locations (again shared).  I wanted to use tomcat with this structure but the
> api 2.2 webapp mechanism seemed too restrictive.
> So I added a couple of new attributes to the <Context> tag to allow for
> additional class repositories and a web page page different from the
> docBase. A few new methods in
>          src/share/org/apache/tomcat/core/
> and a change to a couple of methods in the same file was all that was needed.
> Now, is this a bad thing?  Could it ever get into standard Tomcat?

I would suggest that such a change *not* be added to the standard Tomcat.  The
thinking for this is the same reasoning that web applications were defined the
way they are in the 2.2 spec -- the whole idea is that you can take a web
application archive (WAR) file, and install it on *any* compliant servlet
container, and it will "just work".  In order for this to be feasible, the
environment expected by a webapp should be self contained.

The way that I deal with shared stuff (both static content like HTML pages/images
and dynamic stuff like shared Java libraries) is set up my build environment with
a common source code control environment, and then have "deploy" scripts that
copy the appropriate files from my build workspace to each of the webapps that
need it.  The Ant build tool <> that we use for
building Tomcat itself makes this approach very reasonable, because it knows
about updating only the files that have been changed.  The extra disk space costs
(versus sharing a common directory) are trivial compared to the cost of giving up
a web app's "self contained" nature.

> I can send patches if anyone is interested, but I'd like to gauge how useful
> the mod is.  For us it made it really practical to use tomcat.

> Richard

Craig McClanahan

See you at ApacheCon Europe <>!
Session VS01 (23-Oct 13h00-17h00):  Sun Technical Briefing
Session T06  (24-Oct 14h00-15h00):  Migrating Apache JServ
                                    Applications to Tomcat

View raw message