What is the best way to perform client-side form validation using Javascript (with minimal code duplication) when using JSR 303 bean validation on the server side? I'm currently using Spring 3 and the Hibernate Validator.
Javascript – JSR 303 Bean Validation + Javascript Client-Side Validation
bean-validationjavajavascriptspringvalidation
Related Topic
- Javascript – How does JavaScript .prototype work
- Cross field validation with Hibernate Validator (JSR 303)
- Java – Which @NotNull Java annotation should I use
- Javascript – How to decide when to use Node.js
- Javascript – Check whether a string matches a regex in JS
- Java – Difference between @Valid and @Validated in Spring
Best Answer
I would suggest that you look at Spring JS, which relies heavily on Dojo. A tutorial can be found here.
Easiest way for yourself to start playing with it is to download Spring Roo, create the petclinic sample application with one of the example-scripts (this takes you 5 minutes) and then play around with how the javascript is integrated. Spring Roo creates an app with the same technology stack that you use (Spring+hibernate+implementation of jsr 303)