CodesJava

Easy learning with example program codes

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:

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

 



Copyright © 2018 CodesJava DMCA.com Protection Status SiteMap