Interesting books

Apache MyFaces 1.2 Web Application Development

Apache MyFaces Trinidad 1.2: A Practical Guide

JSF 1.2 Components

Bart on the web
  • View my profile on LinkedIn
  • I'm proud member of the NLJUG
  • View my bookmarks on Delicious.com
  • My profile on Plaxo
« Oracle ADF and Virtual Private Database | Main | RegEx testers compared »
Thursday
08Jan2009

Apache MyFaces Extensions Validator introduced

In a typical Java EE web application, there’s almost always the problem of where to put the validation. Of course there’s only one place where validation belongs: in the model. So if you’re e.g. using EJB as persistence layer, the EJB Entities is where the validation code belongs. However, from a usability point of view, one never wants to leave all validation out of the UI code. This often leads to duplicate validation code. While not ideal, duplicate validation code is often considered as inevitable.

Yesterday I stumled upon Apache MyFaces Extensions Validator (a.k.a. ExtVal, formerly sev-en), a JSF based solution that looks very promising. I did not have a chance to try it myself yet, but it promises some nice things:

  • Annotation based validation. Annotations can be placed anywhere in the Java code: in backing beans as well as in EJB entities:
  • Reuse of EJB annotations. If you for example use a @Column(nullable=false) annotation, ExtVal will know the field is required and there will be no need to add an required validation manually.
  • ExtVal is extensible, allowing you to define your own annotations or reuse other annotations.
  • Even client side validation is covered. (Be it somewhat limited at the moment…)

ExtVal cannot be called mature yet, but it certainly looks promising! I’ll give it a try as soon as I get the chance! Please leave a comment if you have some experience with ExtVal already.

Further information:

 

PrintView Printer Friendly Version

EmailEmail Article to Friend

References (5)

References allow you to track sources for this article, as well as articles that were written in response to this article.

Reader Comments (1)

Ah!!! at last I found what I was looking for. Somtimes it takes so much effort to find even tiny useful piece of information.
Nice post. Thanks

November 7, 2009 | Unregistered CommenterAuto Insurance Guy

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>