What are the different ways to resolve UI messages and provide internalization support in an web application using spring framework?
We use property files and ResourceBundleMessageSource to resolve messages in Spring. Spring's implementation causes an high cpu usage in our application. There are two problems with ResourceBundleMessageSource implementation.
Though there are workarounds for both of the above problems (by extending the class and overridding the behavior) I wanted to know if there are other ways in spring framework to provide internationalization support to a web application.
Thanks in advance
You can use the ReloadableResourceBundleMessageSource instead. It provides some internal caching.
If that does not work, I would advise implementing your own MessageSource (It's fairly straight forward). Spring provides AbstractMessageSource which may be helpful to start with.
From there, you can implement some caching. More than likely, your localizations are not being updated frequently.
You can read here on using the new Cacheable annotations in Spring 3.1
I have done this already with success in applications that allow admins to override locales in the database. Your particular implementation however would obviously be very different.