On Sun, 12 Sep 2004 18:45:31 -0500, Joe Germuska <[EMAIL PROTECTED]> wrote: > At 1:41 PM -0700 9/12/04, Martin Cooper wrote: > >There appears to be a bug in the way that the error messages are put > >together in the validator code. The problem shows up in both the > >server side and client side messages, and I suspect appears only for > >messages that have more than one argument. > > > >The easiest way to see the problem is in the registration tests in > >the validator module of the struts-examples app. If you just stick > >an "a" in every field and click Save, you'll see: > > > >o 5 can not be less than null characters. > >o Zip is invalid. > >o Phone is invalid. > >o E-mail is an invalid e-mail address. > > > >The first of these is clearly wrong, and should have read "First > >Name can not be less than 5 characters". Somehow the field name > >seems to have been missed from the args. > > > >I've taken a quick look at the code, and don't see where things are > >going wrong, so I'm hoping someone more familiar with that code > >could take a quick look also, and see if they can spot the problem. > > The bug is in the XML, not in the code. When using the <arg> > element, one should use the "position" attribute to specify where in > the arg array the specific argument belongs. (So I've just > discovered.)
I just figured out the same thing. ;-} While I think this is OK for now, I really think this is a Validator bug. You shouldn't have to specify the position explicitly; it would be perfectly logical for the lack of the 'position' attribute to mean 'next'. That's certainly what I would have expected, anyway. Oh well. Thanks for fixing it, Joe. -- Martin Cooper > > So whenever the XML was adjusted to use <arg> instead of <arg0>, > <arg1>, etc, it looks like that step was just overlooked. > > I think I fixed it in all the relevant places: min length for first > name, max length for last name, and the int and float ranges on the > type validation form. Hopefully I didn't miss any! > > Joe > > -- > Joe Germuska > [EMAIL PROTECTED] > http://blog.germuska.com > "In fact, when I die, if I don't hear 'A Love Supreme,' I'll turn > back; I'll know I'm in the wrong place." > - Carlos Santana > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]