Jsf validator tag tutorial

What is a validator?

In programming validator is used to transform the component data from strings to Java objects and vice versa.

JSF validator tags:

JSF provides inbuilt validators to validate the UI component data. JSF validators can validates length, type, format etc.
For using JSF validator tags we have to use the following namespaces of URI in html node.
<html 
xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
>

Commonly used JSF validator tags:

TagDescription
  1. f:validateLength
It validates length of a string
  1. f:validateLongRange
It validates range of numeric value
  1. f:validateDoubleRange
It validates range of float value
  1. f:validateRegex
It validates JSF component with a given regular expression.
  1. f:validateRequired
It validates that the input field is not empty. 
  1. Custom Validator
It creates a custom validator

No comments: