[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - How do I extend MessageInterpolator?

krica do-not-reply at jboss.com
Sun Jun 17 05:21:28 EDT 2007


Sorry if this is not the right forum, but I couldn't find a dedicated Hibernate Validator forum.

In my application, I have validation on a field which changes dynamically, at runtime. Thus, the error message displayed to the customer needs to be dynamic as well. This means that I cannot use a ResourceBundle. The reference docs state that I can extend MessageInterpolator and refers to the JavaDocs, but the JavaDoc has next to no documentation. I have tried to debug my way through all this, but I am not getting very far.

So far I have deduced (probably incorrectly) that I need to register the MessageInterpolator with the property "hibernate.validator.message_interpolator_class", and I (think) I have done so. However, its interpolate method is never called.

I am using JBoss Seam, and have registered it in persistence.xml by adding the following:
<property name="hibernate.validator.message_interpolator_class" value="com.x.x.x.BBMessageInterpolator"/>
  | 

Can anybody shed some light on how to actually get the extended MessageInterpolator to be used?

Thanks!

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4055013#4055013

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4055013



More information about the jboss-user mailing list