You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by j h <jh...@ic.ac.uk> on 2004/07/08 13:22:34 UTC

application configuration

If there are specific properties that need to be configured on deployment, 
where should these be put? you could put these in the application.properties 
file and read these in from an Action class every time they are needed:
MessageResources mr = getResources(request);
String config = mr.getMessage("configuration.detail");

This seems inefficient. Is there a way to read these into some global 
variables?




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: application configuration

Posted by j h <jh...@ic.ac.uk>.
Please can you give some example code for this


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: application configuration

Posted by Andrew Hill <an...@gridnode.com>.
I tend to put such things in XML files rather than properties files
nowadays.

When the app starts up I have a plugin read the files and create
configuration objects (using Digester), and put these objects into the
servlet context (application scope) where my code can get at them easily.


-----Original Message-----
From: news [mailto:news@sea.gmane.org]On Behalf Of j h
Sent: Thursday, 8 July 2004 19:23
To: user@struts.apache.org
Subject: application configuration


If there are specific properties that need to be configured on deployment,
where should these be put? you could put these in the application.properties
file and read these in from an Action class every time they are needed:
MessageResources mr = getResources(request);
String config = mr.getMessage("configuration.detail");

This seems inefficient. Is there a way to read these into some global
variables?




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org