简体   繁体   中英

How to implement hot reloading of resourcebundle (messages.properties) in Seam 2

We are still using Seam 2 (2.2.GA) for one legacy webapp. We have JRebel to hot-reload all the stuffs (xhtml, java), but not the i18n messages.properties. Its so annoying!

So, what have we tried? We tried to override the following Seam's built-in components while debug mode (during development):

  • org.jboss.seam.core.ResourceLoader - @Name("org.jboss.seam.core.resourceLoader")
  • org.jboss.seam.international.Messages - @Name("org.jboss.seam.international.messagesFactory")
  • org.jboss.seam.core.ResourceBundle - @Name("org.jboss.seam.core.resourceBundle")

and the following classes are also overrided:

  • DynamicSeamResourceBundle extends org.jboss.seam.core.SeamResourceBundle (so that it does NOT cache the bundles intenally anymore, the own caching mechanis of seam)
  • DynamicResourceBundleControl extends ResourceBundle.Control (with timeToLive = TTL_DONT_CACHE to override the caching behavior of Java)

Of course, the customized components are initialized and used by Seam and of course the properties files have bean changes before each try. But all the tricks do not help! The Idee of the customized codes can be found here: https://community.jboss.org/thread/184261

Pls help me!

Did you report the issue to JRebel forums/support? I'm sure it can be implemented in JRebel-Seam integration

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM