Bean Validation and JSR 303 | Java | DZone
JSR 303 Bean Validation
Finally, JSR 303 came to fruitition. Two important facts: it is end-agnostic, meaning you can use it anywhere you like (front-end, back-end, even DTO if you follow this pattern) and its reference implementation is Hibernate Validator v4.
JSR 303 features include:
- validation on two different levels: attribute or entire bean. That was not possible with Hibernate Validator (since it was database oriented) and only possible with much limitations with Commons Validator
- i18n ready and message are parameterized
- extensible with your own validators
- configurable with annotations or XML. In the following, only the annotation configuration will be shown
In JSR 303, validation is the result of the interaction between:
- the annotation itself. Some come with JSR 303, but you can build your own
- the class that will validate the annotated bean
Read full article from Bean Validation and JSR 303 | Java | DZone
No comments:
Post a Comment