O'Reilly logo

JSF 1.2 Components by Ian Hlavats

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

Implementing JSF validation with Seam

The Seam framework can simplify the process of implementing JSF validation. Firstly, Seam encourages us to follow the "DRY" principle ("Don't Repeat Yourself") popularized in The Pragmatic Programmer and advises us to try to avoid repetition when writing code. We can apply the DRY principle to JSF by declaring our validation constraints once and only once in our domain model. This can be accomplished using Seam's built-in support for the Hibernate Validator framework.

Secondly, Seam removes the need to declare additional validators in our user interface. Registering validators such as the<f:validateLongRange> or<t:validateEmail> with our components and declaring custom validators in faces-config.xml becomes ...

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