tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject Re: TC33b1 Context path behavior: Is this a bug or by design?
Date Sun, 05 Aug 2001 17:48:31 GMT
On Sun, 5 Aug 2001, Randall Parker wrote:

> Costin,
> If one does define a context in apps-XXXX.xml can one sent
> context-param tags in it that are then accessible as part of that
> ServletContext?
> More generally, can anything from webl.xml be put in server.xml inside
> a Context tag's scope?

No, and that's premeditated :-)

Keep in mind server.xml ( and apps.xml ) is an ad-hoc format, and just one
of the ways to configure tomcat ( there is absolutely nothing in tomcat
that cares about server.xml except a small module that happens to read
it). Tomcat doesn't care how is configured - it can be ServerXmlReader
module, or it can read the modules from a properties file or from an LDAP

Web.xml on the other side is a clearly specified format. If something can
be done in web.xml, it should be done there.

But of course, that's just how "proper jakarta-tomcat" works - i.e. how
the current set of modules operate. This is what we provide and support -
for anything fancy you can write your own modules, the way you want them.
It would be trivial to enhance ContextXmlReader - the module that deals
with <Context> definitions - to support what you want ( but I'm -1 on
adding any such enhancement to tomcat3.3 - we already have more than we
need, the 'proper' tomcat should have 1/2 of the modules it has today ).

> If one does this and it works then a further question: Suppose the
> web.xml defines the pdf-out-path and then the server.xml/apps-XXXX.xml
> redefines it again for the same context. Will the
> latter value _replace_ the former value?

It's up to you and your module. Again, IMHO whatever can be specified in
web.xml should be specified there.

Tomcat3.3 ( and 3.2 ) already removes another odity - the "default"
web.xml that generated so many bugs and mess in 3.1. If you want your
application to be portable, make sure it has all the information it needs
in its web.xml - anything you put in apps-XXX.xml, server.xml, etc is
specific to tomcat3.x and will be lost if you move your app to a different


View raw message