-
Website
http://www.cwinters.com -
Original page
http://www.cwinters.com/blog/2009/05/04/java_validation_framework_in_javascript.html -
Subscribe
All Comments -
Community
-
Top Commenters
-
Dave
1 comment · 1 points
-
Chris Winters
4 comments · 1 points
-
dshaw
2 comments · 3 points
-
benketteridge
1 comment · 1 points
-
justatheory
1 comment · 1 points
-
-
Popular Threads
-
cwinters.com | Christmas goodies
3 days ago · 1 comment
-
cwinters.com | Christmas goodies
Chris
Spring and DWR:
* http://today.java.net/pub/a/today/2007/12/02/aj...
* http://www.codercorp.com/blog/spring/ajax-based...
* http://internna.blogspot.com/2007/03/generic-va...
I need to figure this out myself. I have two projects where we're using the simpler MVCJ (Jersey) as the main framework and I'm going to have to wire in some validation to our forms soon.
An emerging option might be to wire in JSR 303 Bean Validation (nee Hibernate Validation). There's apparently a JSF extension that wires in the view layer if you're in JSF-land, but I'm personally not interested in that. ( http://www.scribd.com/doc/7283078/Hibernate-Val... )
Ping me if you come up with something else interesting.
Put another way: I don't think there's any reason to tax the server for rudimentary things like length or regex checking, or any of the large number of validations you can perform given only the data on the page. True, you can use code generation to create these rules in JS. But as a former codegen zealot I am now hugely wary of any solution that depends on it :-)
The JSR-303 stuff looks interesting as well, but I feel like it's at the wrong level -- IME users only rarely manipulate single objects at a time. I don't have anything more than that vague gut feeling right now.
I have a few validation links around, including an early JSR-303 implementation:
http://delicious.com/cwinters/validation
I too resisted relying too much on JavaScript since the Defense contracts I worked on for years had heavy requirements for backward / degradable compatibility. However, whenever I've used frameworks in the past that handle both Server and Client side validation, I've always found one or the other to be lacking, so I've become a bit skeptical. It's a good Holy Grail, but IME validation is still a PITA to nail down correctly.