ResourceBundle not reloaded in webapp

Hi,

We have a webapp that uses java.util.ResourceBundle for localization. Nothing fancy here. In development, while working in IntelliJ, the ResourceBundles are not reloaded after we update resources and we invoke ResourceBundle.clearCache(). After investigation, it seems that IntelliJ doesn't refresh the properties file in the webapp, like it does for JSP pages for example. If we want to see the updated resources, we have to restart the appserver, which slows down the development process dramatically. Is this a problem with IntelliJ?

Here's our setup, if it helps:
IntelliJ 10.5.2
App Server: JBoss 4.2.3

Regards,

Etienne

5 comments
Comment actions Permalink

Hi Etienne.
Is your properties file on classpath or in web resources? idea doesn't update classpath on reload resources, but web content only.

regards, Alex

0
Comment actions Permalink

Hi Alex,

Thanks for your response. In development mode, the properties files are on the classpath. Would it be possible for IntelliJ to update the properties files on the classpath, like it updates compiled classes for instance? It is a pain to have to restart the webserver for a simple change in a resource file.

Regards,

Etienne

0
Comment actions Permalink

Hi, Etienne.
If you invoke Crtrl+Shift+9 in the editor on a property file, updated version should be packaged to classpath. So, your reloader will be able to pickup changes. Also webservers (Tomcat for example) and frameworks(aka spring) supports automatic reloading of resources, so it's also could be leveraged.

regards, Alex

Message was edited by: Alexander Ashitkin

0
Comment actions Permalink

It works great! I didn't think of hitting CTRL+SHIFT+F9 since I considered that properties files were "resources", but I understand now that the "Update Resources" functionality" of IntelliJ applies to web resources.

Thanks a lot.

Etienn

0
Comment actions Permalink

Hi, Etienne. by the way - you can use the same shortkey to package singlejsp, etc instead of reloading all.

regards, Alex

0

Please sign in to leave a comment.