Integrating Hibernate Validator with Spring MVC
Remember when I wrote about Better client-side validation with Prototype back in May? Ted Bergeron responded to my post with the following comment:
Now that I am using Hibernate Annotations Validator, I stopped using commons validator. You can use the hibernate validator without using hibernate for persistence. I wrote some jsp 2.0 tag files to handle binding my form fields with spring mvc, and I use reflection to check for the validation annotations. This makes it no work to have a js calendar for all Date fields, or have class="required" added to all fields that have a @NotNull annotation. I'd be happy to send you the code for appfuse 2.0.
Ted followed up by sending me the code. I took a look at it, and reviewed a well-written PDF he'd written for his work. I told him he should publish it as an article, hooked him up with some folks at IBM developerWorks - and voila! Ted's article, titled Hibernate can meet your validation needs was published yesterday. Nice work Ted!
I'm looking forward to trying to leverage Hibernate Validation annotations for all the web frameworks in AppFuse. Should be interesting hacking into the cores of the frameworks to modify how their validation engines work.