At 6:35 PM +0530 5/12/04, Janarthan Sathiamurthy wrote:
Hi,

Those links were informative.
But i want to reload only my ApplicationResource.properties.
Any hints on how to tweak this ?

For now, the solution is to create your own implementations of MessageResources and MessageResourcesFactory, and then, when configuring the resource in struts-config.xml, specifying your own MessageResourcesFactory class.


Your MessageResources (possibly extending PropertyMessageResources) would either check the file system to see if reloading was necessary upon calls to getMessage() or would somehow accept an external instruction to reload itself. For example, you might configure an Action to accept a resource bundle name and then look up the bundle in the application context and call a "reload()" method.

http://jakarta.apache.org/struts/api/org/apache/struts/util/MessageResources.html
http://jakarta.apache.org/struts/api/org/apache/struts/util/MessageResourcesFactory.html
http://jakarta.apache.org/struts/userGuide/configuration.html#resources_config
http://jakarta.apache.org/struts/api/org/apache/struts/util/PropertyMessageResources.html

If you get interested in this whole problem, note that there's some activity underway to factor out Struts' message resource handling into a reusable package (commons-resources), and then to refactor Struts to use the library. This may happen on a Struts 1.3 timeframe if people have the energy and interest.

http://jakarta.apache.org/commons/sandbox/resources/

Joe

--
Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com "Imagine if every Thursday your shoes exploded if you tied them the usual way. This happens to us all the time with computers, and nobody thinks of complaining."
-- Jef Raskin


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



Reply via email to