The Java EE 5 Tutorial

Validating a Component’s Value

In order to validate a component’s value using a particular validator, you need to register the validator on the component. You have three ways to do this:

See Referencing a Method That Performs ValidationReferencing a Method That Performs Validation for more information on using the validator attribute.

The validatorId attribute works similarly to the converterId attribute of the converter tag, as described in Converting a Component’s Value. See Binding Converters, Listeners, and Validators to Backing Bean Properties for more information on using the binding attribute of the validator tag.

Keep in mind that validation can be performed only on components that implement EditableValueHolder because these components accept values that can be validated.