tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Funk <funk...@joedog.org>
Subject Re: context-param vs env-entry. Ready? Fight!
Date Fri, 31 Aug 2007 11:01:30 GMT
context-param requires access to the servlet context.
env-entry requires access to jndi

Do you really want code that has nothing to do with the servlet api 
dependent on ServletContext? Plugging in a new jndi lookup for testing 
is much easier.

-Tim

Brian Munroe wrote:
> I just started to help maintain an application that I didn't
> originally develop.  It is using <context-param> elements and
> getInitParameter() to access application configuration items in
> web.xml.
> 
> I have always used <env-entry> elements and JNDI to store and read
> these items, respectively.  Refactoring the code to use <env-entry>'s
> could be tedious, so I am looking for any advantages or disadvantages
> for using either method.
> 
> One thing I did learn is that <env-entry>'s can be modifed during
> runtime?  Also, since they are using JNDI, if I needed to migrate the
> configuration items to a different datastore, reworking the code might
> be easier.
> 

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message