Bean-Validation with MyFaces ExtVal
Setup
As usual it's quite easy to use BV with MyFaces ExtVal.
Use the Validation-Module for BV (myfaces-extval-bean-validation-x.x.3+ e.g.: myfaces-extval-bean-validation-1.2.3.jar) instead or in addition to the property-validation module of ExtVal. BV is a different story, however, you can use both validation modules in parallel. Also the component support modules (or the optional generic support module to enable e.g. RichFaces support) are completely compatible and can be used as usual.
Besides the core of ExtVal and the BV integration module, you just have to add BV itself (e.g. Hibernate Validator v4). After adding the required jar libs to the project you can start using BV constraints immediately without additional configuration.
So basically that's it!
Available Examples
Besides the examples which are shipped with ExtVal r3+ itself there are some examples out there.
E.g. there is a sample application which shows JSF 1.2 + PrimeFaces + MyFaces ExtVal in action.
Also os890/bv will provide some additional examples.
Advanced Features
Compared to the standard integration of BV in JSF 2.0+ MyFaces ExtVal offers additional features.
For example
- Typesafe group validation via annotations (instead of the tag f:validateBean)
- Severity aware validation (+ nonblocking warn mode)
- Model validation
- Component initialization
- Trinidad based client-side validation
- Dependency injection
- Integration in JSF 1.x (and 2.x)
Mapped constraint source (ExtVal r4+)
- ...
More details are available here