This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Java in General and the fly likes Problem with ResourseBundle.Control Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Problem with ResourseBundle.Control" Watch "Problem with ResourseBundle.Control" New topic
Author

Problem with ResourseBundle.Control

PradeepKumar Dev Venkata
Greenhorn

Joined: Feb 19, 2009
Posts: 6
Hello all,

I have a requirement to make our web application to reload the ResourceBundle (a properties file) for regular interval. Basically this is to avoid restarting the application server for .properties file changes (FYI..we use Struts Framework and Jboss application server).

For this, I used a util class which will extends ResourceBundle.Control in Java SE 6 and override its getFormats() and newBundle() methods, made getTimeToLive method to return different timeToLive values TTL_DONT_CACHE,0 etc.. and passed this instance to in ResourceBundle.getBundle method.

Something like below...

In Action class:

ResourceBundle msgBundle = ResourceBundle.getBundle("resources.ApplicationResources",ResourceBundleController.instance());

PROBLEM IS: With these changes I couldnt achive the expected outcome. Application is not reloading the cache for any of the timeToLive I mentioned above..

I also have a doubt how can I do same changes on jsp which uses struts <bean:message .. > tag.

Please correct me if I am wrong anywhere... or suggest any other alternative. Any help is really appreciated.


Below is the util class (ResourceBundleController) used FYI ::



Thanks in advance,
Pradeep

 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Problem with ResourseBundle.Control
 
Similar Threads
language propertis to xml properties
XML reading issues
How to read Franch from ResourceBundle
Problem with ResourseBundle.Control using struts
Problem with ResourseBundle.Control using struts