New component: ValidateBeanBehavior

Details

Description

I've been playing with Bean Validation and JSF2 ClientBehavior. I've written a simple ClientBehavior which renders JavaScript validations, based on the Bean Validation constraints.

The developer only needs to nest a <s:validateBean /> into a UICommand component and the Behavior renders the necessary JavaScript.

As I said, it's a start. It currently only supports some validations:

JSF required attribute.

Numeric and date formats, based on how the converter is configured (i.e. a pattern like: "dd-MM-yyyy").

Bean Validation @NotNull, @Min, @Max and @Future.

It should be usable in Mojarra, since I simply copied the MyFaces dependencies to the component (ExternalSpecifications.java, FacesMessageInterpolator.java and the other Bean Validation related classes).

It still needs some work (like supporting other annotations, and more datestyle patterns), but it's a start.