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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to