4 Replies Latest reply on Nov 10, 2009 9:29 PM by Oliver Libutzki

    bean validation

    Dmitry Trunikov Newbie

      Hi ALL :)

      I need in your advice how to solve following trouble.

      There is a bean User which contains two properties passwd and passwd2.
      There is a form which is used to manage user properties. This form, among other options, allows to change user password. During form submit an application has to check these properties (passwd and passwd2) on an equality.

      I run into a challenge how to do that validation. I can't use a simple Seam (or JSF) custom validator as it accepts only one value for checking (Is it true?). I can't use application level validation (in action method) as the bean User is EJB entity and it will be saved in a database at the end of request/transaction in any case. In other words application-level validation has influence on navigation only.

      I wrote a simple Hibernate bean validator. Unfortunatelly it just throws exception (if validation fails) and that exception is displayed on Seam debug page.
      So please advice me any solution(s).

      Thanks in advance.