20030121 Tuesday January 21, 2003

Using XDoclet to generate your validation.xml? Are you using XDoclet to generate the validation.xml file for Struts' Validator Framework? If you're using Struts and you're not using the Validator - you should be IMO. It makes both client-side and server-side validation soooo simple. Using XDoclet to generate the key file (validation.xml) makes implementation a piece of cake. We have Erik to thank for this wonderful addition to XDoclet. Much appreciated sir!

I'm guessing that not many people are using this feature b/c it works kinda funky right now. It disregards the order of your properties in your ValidatorForm and generates entries in alphabetical order. This is great except the client-side (JavaScript) piece of the Validator uses the order to determine which fields to validate first. This has caused a slight headache for me on my project, so I fixed it. Checkout XDoclet's JIRA for the bug and the patch. Hopefully it'll get committed soon, but in the meantime, I'll continue using my patched Apache module that allows me to generate ActionForms from POJOs and orders my validation.xml correctly. Posted in Java at Jan 21 2003, 10:12:23 PM MST 6 Comments

Comments:

Your patch has been applied ;-)

Posted by Aslak Hellesøy on January 22, 2003 at 07:27 AM MST #

Sweet!! Thanks Aslak!

Posted by Matt Raible on January 22, 2003 at 07:39 AM MST #

Even with this patch, its still not ideal for JavaScript ordering. Having to order setters in your ActionForm to affect how the JavaScript validation works is a bit brittle, methinks. Glad the patch was applied though. I don't use the client-side validation piece personally - I just let the server-side handle it. Its nice to have the client-side capability though, don't get me wrong. My projects just don't require it. It seems the client-side infrastructure should be improved rather than relying on the ordering in the ActionForm.

Posted by Erik Hatcher on January 22, 2003 at 07:50 AM MST #

Matt, please try the updated XDoclet code after my changes to SequencedHashMap - XDoclet needs to be JDK1.3-compliant!

Posted by Erik Hatcher on January 22, 2003 at 12:27 PM MST #

Matt, I am going to be using a lot of your modifications and techniques in a upcoming personal project. I just want to think you for all the work and sharing you have done. These item will be _very_ helpful in my project and are things that I think should have been done already. Thanks again, --Kurt

Posted by Kurt on January 23, 2003 at 01:33 PM MST #

Not gonna be much good if you use DynaForms though :(

Posted by Mark Quinn on April 24, 2004 at 10:33 AM MDT #

Post a Comment:
  • HTML Syntax: Allowed