• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Reloading ResourceBundle, MessageResources

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have a application in struts where if there is change in ResourceBundle properties file, I have to reload it without starting the server.

I have created the Action which is called after there is change in ResourceBundle,
The code is shown below :


But this does not work. Is there a way to reload?
If somebody has sample code, please can you forward
[ July 28, 2006: Message edited by: Merrill Higginson ]
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
VijayRawat Rawat
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Merril for your suggestion but I do not need to re-start the application also.
Can you tell me any other way
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic