JSF custom converters run on the server/client side and can accomplish many specific business needs. Basically, JSF custom converters are created by extending the
javax.faces.convert.Converter interface or by extending a standard converter class. In this recipe, you will see both cases.
We developed this recipe with NetBeans 6.8, JSF 2.0, and GlassFish v3. The JSF 2.0 classes were obtained from the NetBeans JSF 2.0 bundled library.
First, let's talk about the converters that implement the
Converters interface. In this case, a converter should implement two methods, as follows:
getAsObject method takes the
FacesContext instance, the UI component, and the
String to be converted ...