i'm trying to reload resource bundle during runtime.
In my application, after the login, i get the properties calling <f:loadBundle basename="messages" var="msg" />
. The call is made in my application base template and all is working well. The property file is located under MyApp/resources/
The next step is trying to update the resourceBundle reading from a property file i have in my userHome/resources. What i'm doing calling my managed bean is:
File file = new File(System.getProperty("user.home")+ "/resources/");
URL[] urls = {file.toURI().toURL()};
ClassLoader loader = new URLClassLoader(urls);
ResourceBundle.clearCache(Thread.currentThread().getContextClassLoader());
ResourceBundle.clearCache();
bundle = ResourceBundle.getBundle("messages",Locale.ENGLISH, loader);
I got no errors and the boundle got the right values BUT any changes took places in my application. Someone can tell me how to reload the bundle and show the new values i got from the external files?? Clear cache doesn't seem to work,i get rid of the faces-config.xml cause of jsf2... Hope someone can help.