JSF Tutorial - JSF Validator Tags








JSF has buildin validators to validate its UI components.

The validator tags can validates length of field, type of input which can be a custom object.

We have to use the following namespaces of URI in html node to include the validator tags.

<html 
   xmlns="http://www.w3.org/1999/xhtml" 
   xmlns:f="http://java.sun.com/jsf/core">
...

Validator Tags

The following table has important Validator Tags in JSF 2.0:

TagDescription
f:validateLengthValidates length of a string
f:validateLongRangeValidates range of numeric value
f:validateDoubleRangeValidates range of float value
f:validateRegexValidate JSF component with a given regular expression.
Custom ValidatorCreating a custom validator