On Wed, 21 Aug 2002 [EMAIL PROTECTED] wrote:

> Date: Wed, 21 Aug 2002 16:37:53 BST
> From: [EMAIL PROTECTED]
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>,
>      [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Configuration in the Web Tier
>
> Hello.
>
> We need to store some configuration in our web tier, and I'm getting objections to 
>the way we've done it.  How do you lot do it?
>
> For example, we need to have control over the order in which credit cards are 
>displayed.  Our back end system will tell us all the credit cards it knows about (in 
>no particular order) and we have an XML configuration file sat on the web server 
>which knows the order we want them in (and this order is configurable from a web page)
>
> These XML configuration files can't be shipped as part of the WAR file, because the 
>user might change them, and we'd overwrite them with the defaults in the next release.
>
> Is there a standard J2EE way of doing this sort of thing?
>

The "standard J2EE way" for this sort of thing is to use JNDI resources
provided by your container.  In the case at hand, you could define an
<env-entry> resource in your web.xml (with an optional default value)
that either contains a particular setting, or is a pathname of a
configuration file local to this deployment, and then use the deployment
tools of your app server to configure the actual value to be used for this
particular deployment (without having to change the WAR).

The mechanism to configure the JNDI resources themselves varies by app
server.  For Tomcat (as an example), check out:

http://jakarta.apache.org/tomcat/tomcat-4.0-doc/jndi-resources-howto.html

http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-resources-howto.html


> Cheers,
>
> Tim.
>

Craig


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to