For now you can access the source code through the Subversion repository. There is a demo webapp project you can download as well.
SVN checkout URLs:
- How It Works
- Supported Validations
- JSR-303 annotations
- Hibernate Validator annotations
- Extra Configuration Via Tag Body JSON Object
- Tag Body JSON Object
- Customizing Error Display
- Adding Support For Other Validation Annotations
Use the codebase taglib
... <%@ taglib prefix="jsr303js" uri="http://kenai.com/projects/jsr303js/" %> ... <jsr303js:codebase/> ...
jar xvf jsr303js-1.0-SNAPSHOT.jar jsr303js-codebase.js
Now to add validation to your form you must use the validate taglib as in this example:
... <body> ... <form:form id="testModelBean" commandName="testModelBean"> ... <jsr303js:validate commandName="testModelBean"/> ...
You can instead have the errors displayed on the page. You can display all errors in an element with an id of 'global_errors', e.g.:
Errors will be added to the element as list items in an unordered list. You can also display errors for a specific field in an element with an id composed of the field name plus the suffix '_error', e.g.:
You can use a global error element, individual field elements, or both. Any error not displayed in an individual field element will be displayed in the global error element.
The global error element id and individual field element id suffix can be customized using the 'globalErrorsId' and 'fieldErrorsIdSuffix' attributes of the codebase taglib.