2 Replies Latest reply on Apr 2, 2009 6:33 AM by Dan Allen

    ANNOUNCE:  Metadata based validation for JavaServer Faces – Part 1

    Kito Mann Newbie


      I am pleased to announce a new article on JSF Central. In the first article of this series, Gerhard Petracek introduces MyFaces ExtVal, a JSF-centric validation platform that provides advanced features not yet available in other JSF validation frameworks.

      Here is an excerpt:

      Validation is an important part of every business application. Therefore JavaServer Faces (JSF) provides a specific phase for it that covers the needs of many web applications. However as time passed, new features and specifications were introduced by the Java Community Process (JCP). One feature that became an important part of Java software development was metadata via annotations. For instance, the Java Persistence API (JPA) uses annotations to simplify development. With annotations, information is attached to the artifact it belongs to. This article illustrates how they can be applied to validation with JSF.

      In JSF, you have to define validation logic for every input component to be validated. In several cases this means you must violate the Don't Repeat Yourself (DRY) principle. A simple example is a property of an entity that is specified as required in JPA. Even though this information is already available in the model, you also have to specify that the input component bound to the mentioned property is required, by setting the required attribute to true. If the model changes, you have to go though all pages of your JSF application and change the corresponding components. You can resolve such restrictions with Apache MyFaces Extensions Validator framework (aka MyFaces ExtVal).

      Read the full article or download the podcast here: Metadata based validation for JavaServer Faces – Part  1

      Kito D. Mann -- Author, JavaServer Faces in Action

      http://twitter.com/kito99  http://twitter.com/jsfcentral

      http://www.virtua.com - JSF/Java EE consulting, training, and mentoring

      http://www.JSFCentral.com - JavaServer Faces FAQ, news, and info

      1 203-404-4848 x3