Loading custom resource bundles
843842Jan 21 2004 — edited Mar 22 2006Is it possible to get JSF to use a different resource resource bundle class or intercept the loading of resource bundles in some way? This may sound like a strange thing to do but I need it for two reasons:
1. My application uses a hierarchy of resource bundles to customise presentation for particular groups of users. I need to be able to select a resource bundle dynamically at runtime according to the currently authenticated user.
2. I want to place all localisable text in a database rather than property files for ease of editing in a clustered environment. I can do this by subclassing java.util.ResourceBundle but am not sure how to get JSF to use the subclass.
I was hoping to find a createResourceBundle method in the Application class that I could override but there is only a method to set the resource bundle name. (As a side issue, shouldn't all the classes in javax.faces.application really be interfaces? Or is the use of abstract classes intended to allow new methods to be added later?)