views:

2719

answers:

2

I'm using hibernate validator framework with Spring. A class implementing the Spring Validator validates objects with Hibernate's ClassValidator. To localize ClassValidator's error messages I need to pass a ResourceBundle into the class' constructor. My ApplicationCountext has a MessageSource bean (ReloadableResourceBundleMessageSource) which is used throught the application. It makes sense to use this same MessafeSource for the ClassValidator. But how do I convert the MessageSource to a ResourceBundle? Is there any adapter class?

A: 

Did you try posting this at the spring forum or the hibernate forum OR the sun java forum ?

It appears that no one here seems to have an answer ?

anjanb
No I didn't, had no time to do it
axk
+1  A: 

MessageSourceResourceBundle sounds like what you are looking for. (Haven't tried it myself.)

flicken
Thanks! Exactly the adapter I was looking for.
axk