O'Reilly logo

Mastering JavaServer Faces 2.2 by Anghel Leonard

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Configuring validators and converters

Data validation is an important part of a JSF application (which has existed since JSF 1.2), because it allows us to separate the business logic from the tedious checks that help us to obtain only valid information from the user. Data is validated in the Process Validations phase (if the immediate attribute is set to true, this processing will occur at the end of the Apply Request Values phase instead) and should be valid and ready to be used before the Update Model Values phase.

Besides the built-in validators, we can write our own customized validators. A public class that implements the Validator interface and overrides the validate method is recognized by JSF as a validator. There are two ways to configure ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required