JSF - Validator Tags


JSF provides inbuilt validators to validate its UI components. These tags can validate the length of the field, the type of input which can be a custom object.

For these tags you need to use the following namespaces of URI in html node.

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

Following are important Validator Tags in JSF 2.0−

S.No Tag & Description
1 f:validateLength

Validates the length of a string

2 f:validateLongRange

Validates the range of a numeric value

3 f:validateDoubleRange

Validates the range of a float value

4 f:validateRegex

Validates JSF component with a given regular expression

5 Custom Validator

Creates a custom validator