Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

@AssertTrue Method not called when submitting JSF page

I am using bean validation with hibernate-validator-4.2.0.Final and JSF 2.1. When i submit the page @NotEmpty, @NotNull,.. works correct , but my method, annotated with @AssertTrue is never called.

I changed the access modifier to public, renamed it to getValid, but the method is never called..

@AssertTrue(message = "test")
    private Boolean isValid() {
        return ....;
    }
like image 559
mp5 Avatar asked Jul 31 '26 07:07

mp5


1 Answers

JSF is not validating a full bean via Validator#validate, but rather calls Validator#validateValue for each form field. Is this isValid a form field?

like image 148
Hardy Avatar answered Aug 01 '26 20:08

Hardy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!