views:

1557

answers:

3

We are using fmt:setBundle to load a resource bundle from a database (we extended the ResourceBundle class to do that). When we modify a value in database, we have to reload the web server to display the new value on the web app.

Is there any simple way to use the new value without restarting the web server ?

(We do not want to always look up the value from database but we would like to invalidate the cache, for example by calling a special 'admin' URL)

EDIT : We are using JDK 1.4, so I would prefer a solution on that version. :)

+4  A: 

If you're using JDK 1.6 you can use the callback methods getTimeToLive() and needsReload() in ResourceBundle.Control to control if the bundle cache needs to be loaded with new values from the database.

WMR
+3  A: 

As others have pointed out in the comments, you might want to look into Spring - particularly the ReloadableResourceBundleMessageSource.

Phill Sacre
A: 

paulgreg? did u got any ans... i am havin same question... Please provide soln in jdk 1.4