hardy.ferentschik wrote:
Hi,
i guess your best bet would be a custom class level constraint. Check the online documentation to see how to implement such a constraints -
http://docs.jboss.org/hibernate/stable/ ... le/#d0e328Using a class level constraint you will get passed the whole entity you are currently validating. If this entity constains a password and confirm password field you can just compare these two values.
--Hardy
Thanks for your answer!
Yes I made such solution, but unfortunately I don't know how to assign error to field, not to class. It's important because I use Annotated validator in Spring and errors are automatically assigned to html form fields.