Logo

Add custom annotation example

November 19th, 2008

A new example has been added, which shows you how to write your own custom validation annotation, write its validator and register it with JaValid. Check the example out here.

JaValid 1.1 released

September 21st, 2008

JaValid 1.1 has been released today and can be downloaded from here. The new documentation can be found here, and the release notes here. Comparing it with the release candidate it contains a number of fixes and a couple of enhancements. The most important things added/changed to the 1.1 release are:

  • Extensions, you can add your own extension to JaValid now. This allows you to add any type of validation needed (e.g. webservices)
  • Database extension. This is a new extension and allows you to check constraints in the database (e.g. check if a name already exists)
  • Added  optional JavalidValidationCallbackHandler when calling validateObject(), which allows you to customize validation before/after validation.
  • Added plural annotations. All existing and new annotations have a plural form now (e.g. @MinLengths (values={@MinLenght(..),@MinLength})
  • Added @DateCheck annotation
  • JSF validator tag now also supports field validation (<jv-ui:validate  />)

Any feedback on the new release is welcome, enjoy!

Update: Example and 1.1 release scheduled

September 17th, 2008

A new example has been added, which explains how to use the validator in JSF directly (check it out here). There are other ways of using the validator in JSF too, such as the <jv-ui:validate />  tag (for property validation as is the standard in JSF). Check out the documentation on how to use this.

It’s been silent for a while, basically because of work and holidays - however the final release of 1.1 is scheduled for next weekend. It fixes a couple of bugs and adds a new method to the extension interface. Stay tuned!

JaValid 1.1-rc1 released!

July 13th, 2008

JaValid 1.1-rc1 has been released as of today. A little later than hoped, but here it is then after all. This release introduces a couple of nice features, of which the most notable is the ‘extension’ mechanism.

The new extension mechanism allows you to add your own extensions to JaValid for validation. For instance: you need to perform complex validation with webservices in certain circumstances, and you want to annotate that type of validation like any other validations in JaValid. Then you would write your own extension (and likely some custom annotations), which knows how to call and handle these webservices. Register your extension and you are done! It’s really not hard, check out the docs!

A new extension introduced in 1.1 is the Database extension, which allows you to perform checks against the database (this also serves as a good example on how to add your own extension if you need source examples.

Please provide feedback, comments, bugs and so on: so these can be taken care of!

Register your feedback on sourceforge, this weblog or mail them directly: feedback@javalid.org Thanks a lot!

The source and distributions are hosted on sourceforge and can be downloaded here. The release notes can be found here.

Have fun with this new release!

To summarize what was added and/or changed the release notes are added below for your convenience:

--------------------------------------------------------------------------------
Changes from 1.0.1 to 1.1rc1
--------------------------------------------------------------------------------

BUGS fixed:

-             Fixed webtest of spring, was broken in Tomcat 5.5
-             Fixed bug with jv-ui:validate tag, which only resolved an expression once.
- 1967984 Fixed incorrect documentation for jv-ui:validate component

FEATURES/ENHANCEMENTS:

- Introduced the option to add your own extensions to JaValid (don't confuse
  with custom annotations). Allowing you to add anything to it you like.
  Extensions from 1.0 (Spring / JSF) are refactored to the new extensions
  standard as well. Check the docs on how to add a new extension!
- Added Database extension for validation. Using available datasources (from container or
  handmade). Check out the docs how to use this!
- Added @DbNumCheck annotation which provides a powerful database check,
  including specialized EL support in the queries.
- Added  JavalidValidationCallbackHandler to be passed when calling a validateObject()
  method. Allows for customization before / after validation.
- Added plural annotations for all existing validation annotations,
  that is you can use a validation annotation multiple times on the same
  field/method e.g @MinLengths(values={@MinLength(..),@MinLength(..)}.
  The original way from 1.0 works still fine too. Check the docs how to
  add this to your own annotations!
  (SF: 1992025  Support use of similar annotations on same field/method)
- Added @DateCheck annotation, which allows to check dates
  (equals, more, less etc).
- Added support for field validation through the jv-ui tag (was only method)
- ValidatorSupport, ReflectionSupport, XMLSupport, JsfSupport, JsfMessageConverter
  refactored, all methods are static final and the constructors are private.
- Added a new web test project which has jsf 1.2 with facelets, as sample, but
  as a test as well.

KNOWN ISSUES:
- LinkageError with javax.el.*
    If you deploy to an application server that already has an el-api.jar in its
    classpath (such as Tomcat 6 or JBoss 4.2 etc), you may encounter a
    LinkageError classloader issue. To solve this you must NOT deploy an el-api
    yourself with your application, nor deploy the juel-api.jar file (juel-impl
    is required!).
    Another solution might be to force classloading your (web)application
    libraries first. Check the documentation of your container on how to do
    this.

Update

June 5th, 2008

It has been a bit silent here, so here’s a little update on what’s going on! As we all know, sometimes customer’s projects demand a little more time than one desires. :)

However in the spare hours there were, hard work’s been done for the JaValid 1.1 release. Not making any promises, but the release candidate is planned for this month! What it will include? Except for quite some refactoring, enhancements and so on: One of the major features included is integrating validation with your database! Stay tuned for a little preview coming weeks!

And as always, feedback is welcome!

JaValid 1.0.1 released

May 16th, 2008

JaValid 1.0.1 has been released. This release fixes some potential errors that may occur when using JSF 1.2/facelets in combinations with some JSF frameworks. The JSF specific code has been abstracted away, and depending on which JSF version in use picks the proper handler. You can download it here.

Have fun!

JaValid 1.0 released!

May 5th, 2008

I am glad to announce that JaValid 1.0 production is released as of today. Download it here. Below this post you can read the release notes, so you can see what changed since the first rc1 up to now. If you have any feedback, bugs, feature requests and so on, please post them. So they can be picked up in one of the next releases. Thanks!

--------------------------------------------------------------------------------
Changes from 1.0-rc2 to 1.0
--------------------------------------------------------------------------------
BUGS fixed:

None.

FEATURES/ENHANCEMENTS:

1954319      Provide selective global message support
1955130	     Add BigInteger / BigDecimal support
1956675	     Add Collection size check annotation
  --         Refactored JvValidator to JavalidValidator (check custom annotations!)
  --         Added more examples

NOTES:

None.

--------------------------------------------------------------------------------

Changes from 1.0-rc1 to 1.0-rc2

--------------------------------------------------------------------------------

BUGS fixed:

1944076      Inheritance validation fails in some cases
1946399	     Cannot use core library directly, noclassdeffounderror

FEATURES/ENHANCEMENTS:
  --         Added a few more examples.

NOTES:

None.

Advanced LovConstraint example added

May 2nd, 2008

A new example has been added to the examples page, which continues where the previous example about the LovConstraint left off. This example shows the dynamic features @LovConstraint can use, with BeanLookup and SpringLookup. Check it out here.

LovConstraint example added

April 25th, 2008

A new example has been added to the examples page, which shows how to use the powerful @LovConstraint annotation in JaValid. Check it out here.

JaValid 1.0-rc2 released

April 19th, 2008

The second release candidate has been released today. What changed since rc1:

Fixed:
1944076  	  Inheritance validation fails in some cases
1946399  	  Cannot use core library directly, noclassdeffounderror

Enhancement:
- Added a few more examples.

This release is intended as the last candidate before the final release. Please provide some feedback, thanks!