Logo

JaValid 1.1 released

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!

2 Responses to “JaValid 1.1 released”

  1. Steve Yao Says:

    Thank you for your great work. This framework is really easy to use. I will change to your validation design on my web mvc framework. You may find it on http://code.google.com/p/jmap/.
    I think many people will use @MaxLength and @MinLength in server side, and I found these annotations use the String.length() method to caculate the string length. The length() method will return character length. In generally, iso-8859 and many latin encoding string will not cause any problem. The unicode string still return character length not byte array length. This may cause problem when this string field be used to insert or update a DB’s varchar column.
    A varchar(20) column just accept 20 bytes length string, this is byte length not a character length. If we use Chinese or Japanese character string, the 11 Chinese or Japanese characters is 22 bytes length. So, the annotation validator may not return error, but I think it may cause problem.
    Maybe we still need this character length validating, and you may add a flag to the @MaxLength and @MinLength to indicate this field should be checked in character length or byte length.
    In the MaxLengthValidatorImpl.validate, check this flag and use the String.getBytes().length or still use the String.length().

  2. Martijn Reuvers Says:

    Thanks Steve, I am glad you like it.

    I added an enhancement for your request (see https://sourceforge.net/tracker/index.php?func=detail&aid=2136098&group_id=222710&atid=1056451) so it will be added in a next release.

Leave a Reply