[jboss-user] [JBoss Seam] - Custom validator scoped to the whole class with annotation

rajeshv7 do-not-reply at jboss.com
Mon Jul 2 05:59:51 EDT 2007


I have written a custom validator that is scoped to the whole class so that I can access multiple properties and do the validation. I had implemented this based on the following article
http://www.jroller.com/page/jgilbert01?entry=extending_the_hibernate_validation_framework

As you see below the IdTypeValidator is my custom validator and I am passing in the Product object as value.

@Entity
@Table(name = "PRODUCTS")
@IdTypeValidator(value=Product.class)
public class Product{
...
}

The validator does get invoked and when the validation fails how to display this error message. As this validator is annotated to the whole class I cannot tie it to any particular field on the JSF page.



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

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



More information about the jboss-user mailing list