tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Assaf Arkin <ar...@exoffice.com>
Subject Re: thanks, and a quick web.xml question
Date Wed, 29 Dec 1999 20:10:07 GMT
> futures ramblings ...
> 
> i had hoped to provide a smoother melding of the "internal/system" web.xml
> data and that which is provided by the context author (eg WEB-INF/web.xml)
> since as it stands one can't readily add new attributes/elements/data to
> internally
> defined data (eg jsp engine) w/o redefining the whole thing all over again ...
> kind'a sucks.

I think it would make sense to override a default web.xml coming from
the Servlet JAR with one specified at deployment time outside the
Servlet JAR. The Servlet engine will read the default one from the JAR,
then the overriding one from a configuration directory.

That's something I'm doing right now in Tyrex to override env-entry
values. A Servlet may (or may not) specify a value for an env-entry that
it plans to use. The deployer can (or must) override it with a value
that's specific to the server not the Servlet.

For example, a Servlet may use an environment entry called ldap-url to
decide which LDAP server it should talk to. web.xml will specify that
such an env-entry exists, but not it's value. At deployment time, a
resources file external to the Servlet (which is never modified
directly) will provide the suitable value for ldap-url, which will
change from server to server.

Something like that could be added for the Servlet properties as well.
(environment entries are the J2EE model that requires you use JNDI to
obtain them)

arkin


> 
> >
> >
> > >
> > > But changing _only_ /etc/web.xml doesn't seem to propagate across all the
> > > context definitions listed in server.xml.
> > >
> > > What am I overlooking or not understanding?
> > >
> >
> > The key concept is that there is one web.xml file for each web application
> > you define with a <Context> element in the "server.xml" file.  For each app,
> > this file is located in the WEB-INF directory under the document base that
> > you specify.  Also, each application is supposed to be independent of any
> > other application.
> >
> > Therefore, if you want to add new servlets or set initialization parameters,
> > you need to do one of the following:
> >
> > * Add your settings to the "web.xml" file for one of the
> >   two existing Contexts.
> >
> > * Create a new web application (with it's own WEB-INF
> >   subdirectory and "web.xml" file).
> >
> > >
> > > Thanks again, a patch is in the works (as soon as I figure out how to use
> > > cvs diff)...
> > >
> > > Jeff
> > >
> >
> > Craig McClanahan
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org

Mime
View raw message