Validate class level bean validation constraints in JSF

后端 未结 1 1437
死守一世寂寞
死守一世寂寞 2020-11-30 15:16

It seems that JSF 2.0 does not call "class level constraints". Quoting from an SO answer

JSF 2.0 doesn\'t call class level validation constrain

1条回答
  •  日久生厌
    2020-11-30 16:17

    Until the upcoming JSF 2.3, JSF doesn't support class level validation using a.o. @Valid. This is an eternal issue, given that the very first JSF spec issue ever addresses this.

    Your resort is either using a 3rd party library which has already taken care of it, or homebrewing it based on sources of the open source library in question (taking licensing into account).

    Apart from SeamFaces which you already found, there's also OmniFaces . The major difference as compared to is that it doesn't use a JSF Validator, but a JSR303 ConstraintValidator (and that you've the whole entity immediately at hands without the need to declare and annotate a bunch of fields, repeating the entity's properties.

    JSF 2.3 support will come in flavor of which is largely based on OmniFaces .

    0 讨论(0)
提交回复
热议问题