I think it depends on how much you will need to alter this information. What I do in my applications is create an app-config.xml file that lives in WEB-INF or the $user.home directory - then I use Castor to turn marshal those values into a JavaBean called Configuration - which I put in the ServletContext and call when I need it. Another approach is to use context-parameters in your web.xml file. However, once you get a bunch of these, you'll want to move to the XML->JavaBean approach.

HTH,

Matt

On Thursday, December 5, 2002, at 08:08 AM, Tim Reilly wrote:

Hi there,

I'm trying to find out what the right place for your own configuration information is.  I'm talking about the kind of stuff you used to just put into a .properties file.  I'm new to Struts, and I'm not sure if there's a better way to do it now.

Does this kind of configuration information belong in:

1) A ServletConfig [seems wrong, since with Struts I don't have my own servlet].
2) Your own .properties file
3) A separate MessageResource file from the one used for your messages?
or
4) Some other place / method of access I don't yet know about.


I can't seem to find an answer to this in the struts-mailing list archives or on the web.

Thanks for your help,

-Tim

Reply via email to