hi hardy,
i know and recently we had the same discussion for deltaspike.
summary:
if you like to use a ResourceBundle, you can use it in your custom MessageResolver easily.
however, in some cases a custom implementation of ResourceBundle just adds complexity you might not need.
the MessageResolver interface defines an easy contract (key + local in and stored message out).
regards,
gerhard
2012/6/25 Hardy Ferentschik
<hardy@hibernate.org>
Ok, I see the difference now. Your proposal goes away completely from bundles of messages and just takes a single message into consideration. Sure that works as well.
What is in your opinion the big gain of MessageResolver over ResourceBundleLocator? Obviously a resource bundle does not have to be backed by a properties file, but you could
return any custom bundle subclass you like. Are bundles not the general way i18n is approached in Java? It seems natural to "bundle" your custom validation messages per locale, or not?
--Hardy