This week's book giveaway is in the Other Open Source APIs forum. We're giving away four copies of Storm Applied and have Sean Allen, Peter Pathirana & Matthew Jankowski on-line! See this thread for details.
I see that you've copied the logic in the ActionServlet's initModuleResources() method. I'm not sure why it doesn't work.
Here's another approach, though:
You do not need to restart the server in order to refresh the message resources file. It is the application that needs to be restarted. Most application servers provide a way to restart an application in batch mode. You may be able to set up some sort of trigger so that if the message properties file is changed, it runs the process to restart the application.
Thanks Merril for your suggestion but I do not need to re-start the application also. Can you tell me any other way
Joined: Feb 15, 2005
I'm afraid I don't know another way. I'd suggest that you not give up on the code you've started with, though. Since you're copying the same code Struts used to initialize the bundle, I don't see a reason why it shouldn't work. You might try checking the variables at various points to see if they contain the new version of the resource bundle.
If you do get it working, please let us know. There have been questions posed by a number of individuals who also want to refresh the message resource bundle, but none have reported any success.
One more thing: If you post code to the forum, it's much more readable if you enclose it in [ c o d e ] [ / c o d e ] brackets. I've taken the liberty of adding them to your original post. [ July 28, 2006: Message edited by: Merrill Higginson ]