<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Chris Winters  - Latest Comments in cwinters.com | Java validation framework in JavaScript?</title><link>http://cwinters.disqus.com/</link><description></description><atom:link href="https://cwinters.disqus.com/cwinterscom_java_validation_framework_in_javascript/latest.rss" rel="self"></atom:link><language>en</language><lastBuildDate>Wed, 13 May 2009 11:57:27 -0000</lastBuildDate><item><title>Re: cwinters.com | Java validation framework in JavaScript?</title><link>http://www.cwinters.com/blog/2009/05/04/java_validation_framework_in_javascript.html#comment-9283608</link><description>&lt;p&gt;Interesting, I look forward to see what you come up with.&lt;/p&gt;&lt;p&gt;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.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">dshaw</dc:creator><pubDate>Wed, 13 May 2009 11:57:27 -0000</pubDate></item><item><title>Re: cwinters.com | Java validation framework in JavaScript?</title><link>http://www.cwinters.com/blog/2009/05/04/java_validation_framework_in_javascript.html#comment-9271232</link><description>&lt;p&gt;I have heard of DWR and similar appraoches. But I'm interested in having the validation code execute *within the browser* on the client-side for most rules, enabling an AJAX invocation for rules that can only be executed on the server (e.g., "is this username unique?"). With Rhino/Java6 there's no reason we cannot execute that same code on the server.&lt;/p&gt;&lt;p&gt;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 :-)&lt;/p&gt;&lt;p&gt;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.&lt;/p&gt;&lt;p&gt;I have a few validation links around, including an early JSR-303 implementation:&lt;/p&gt;&lt;p&gt;&lt;a href="http://delicious.com/cwinters/validation" rel="nofollow noopener" target="_blank" title="http://delicious.com/cwinters/validation"&gt;http://delicious.com/cwinte...&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Chris Winters</dc:creator><pubDate>Wed, 13 May 2009 01:48:45 -0000</pubDate></item><item><title>Re: cwinters.com | Java validation framework in JavaScript?</title><link>http://www.cwinters.com/blog/2009/05/04/java_validation_framework_in_javascript.html#comment-9255809</link><description>&lt;p&gt;If you're using Spring, you can wire your validation in using DWR (Direct Web Remoting). Appfuse-light uses this approach ( &lt;a href="https://appfuse-light.dev.java.net" rel="nofollow noopener" target="_blank" title="https://appfuse-light.dev.java.net"&gt;https://appfuse-light.dev.j...&lt;/a&gt; ), as does the far more obscure IWebMvc ( &lt;a href="http://code.google.com/p/internna/" rel="nofollow noopener" target="_blank" title="http://code.google.com/p/internna/"&gt;http://code.google.com/p/in...&lt;/a&gt; ).&lt;/p&gt;&lt;p&gt;Spring and DWR:&lt;br&gt;* &lt;a href="http://today.java.net/pub/a/today/2007/12/02/ajax-form-validation-2.html" rel="nofollow noopener" target="_blank" title="http://today.java.net/pub/a/today/2007/12/02/ajax-form-validation-2.html"&gt;http://today.java.net/pub/a...&lt;/a&gt;&lt;br&gt;* &lt;a href="http://www.codercorp.com/blog/spring/ajax-based-form-validation-with-spring-and-dwr.html" rel="nofollow noopener" target="_blank" title="http://www.codercorp.com/blog/spring/ajax-based-form-validation-with-spring-and-dwr.html"&gt;http://www.codercorp.com/bl...&lt;/a&gt;&lt;br&gt;* &lt;a href="http://internna.blogspot.com/2007/03/generic-validator-for-spring-mvc-dwr.html" rel="nofollow noopener" target="_blank" title="http://internna.blogspot.com/2007/03/generic-validator-for-spring-mvc-dwr.html"&gt;http://internna.blogspot.co...&lt;/a&gt;&lt;/p&gt;&lt;p&gt;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.&lt;/p&gt;&lt;p&gt;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. ( &lt;a href="http://www.scribd.com/doc/7283078/Hibernate-Validator" rel="nofollow noopener" target="_blank" title="http://www.scribd.com/doc/7283078/Hibernate-Validator"&gt;http://www.scribd.com/doc/7...&lt;/a&gt; )&lt;/p&gt;&lt;p&gt;Ping me if you come up with something else interesting.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">dshaw</dc:creator><pubDate>Tue, 12 May 2009 16:04:44 -0000</pubDate></item><item><title>Re: cwinters.com | Java validation framework in JavaScript?</title><link>http://www.cwinters.com/blog/2009/05/04/java_validation_framework_in_javascript.html#comment-9002104</link><description>&lt;p&gt;Antti - Rhino or the java6 built-in scripting (a modified Rhino) is exactly what I was thinking of. I think you'd be able to abstract out the differences enough that nearly all your validation code could be written without caring which you were running on.&lt;/p&gt;&lt;p&gt;Chris&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Chris Winters</dc:creator><pubDate>Mon, 04 May 2009 22:54:42 -0000</pubDate></item><item><title>Re: cwinters.com | Java validation framework in JavaScript?</title><link>http://www.cwinters.com/blog/2009/05/04/java_validation_framework_in_javascript.html#comment-8990622</link><description>&lt;p&gt;I am not sure if I understood the problem correctly but have you thought of doing the validation on the server side using a javascript interpreter like Rhino?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Antti Vähäkotamäki</dc:creator><pubDate>Mon, 04 May 2009 16:03:08 -0000</pubDate></item></channel></rss>