JSF converter tags tutorial

What is a converter?

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

JSF converter tags:

JSF provides inbuilt convertors to transform the UI component data from strings to Java objects used in a managed bean and vice versa. For example a date object is represented by a text string on web form which can be converted back to the date object by using converters.

For using JSF converter 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 converter tags:

Tag Description
  1. f:convertNumber
It is used to converts a string into a number of specific format
  1. f:convertDateTime
It is used to converts a string into a date of specific format
  1. Custom Convertor
It is used to create a custom convertor