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"> ...
The following table has important Validator Tags in JSF 2.0:
Tag | Description |
---|---|
f:validateLength | Validates length of a string |
f:validateLongRange | Validates range of numeric value |
f:validateDoubleRange | Validates range of float value |
f:validateRegex | Validate JSF component with a given regular expression. |
Custom Validator | Creating a custom validator |