In many ways, the JSF validation framework follows the example of previous MVC frameworks, such as Struts. The Struts framework introduced an XML-based validation layer that enabled developers to declare validation rules in an XML file, which the framework would then apply to form bean properties during form submission. Struts includes a number of built-in validators to support common scenarios, such as checking for required fields, verifying a numeric value, and validating a credit card number format.
The JSF validation framework also includes a number of built-in validators that can be registered on components in the view, such as the<f:validateLongRange>
and<f:validateLength>
tags. It is important to note that JSF validators are not components themselves, but rather they are classes that implement the javax.faces.validator.Validator
interface that are invoked during the conversion/validation phase of the JSF request processing...