You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by John Cavacas <jo...@sapiens.com> on 2003/06/08 23:42:30 UTC

RE: [validator] arg0-arg3 elements need name attribute to display message?

Thanks for the reply David. I'll update my source from CVS and build from
there. 

I'm glad someone is doing some work on the validator. And speaking of that,
I will most likely be using the validator extensively pretty soon in a new
application, which may result in some contributions. Are there specific bugs
or feature requests where help is needed?

Thanks,
John

> -----Original Message-----
> From: David Graham [mailto:dgraham1980@hotmail.com]
> Sent: Sunday, June 08, 2003 4:52 PM
> To: struts-user@jakarta.apache.org
> Cc: commons-user@jakarta.apache.org
> Subject: Re: [validator] arg0-arg3 elements need name attribute to display
> message?
> 
> This is a bug in the recent commons-validator nightly builds.  Download
> commons-validator 1.0.2 or tomorrow's build.  I have been doing some major
> refactoring over in commons-validator and unfortunately broke the arg
> configuration :-(.  On the bright side, in future commons-validator
> versions
> you'll be able to define more than 4 replacement args :-).
> 
> David
> 
> >I've been doing some messing around with the Validator and ran into an
> >issue
> >I haven't seen mentioned on the list yet. I'm using 2 day old nightly
> >builds
> >of Struts and commons-validator. Now, this is my first time trying out
> the
> >validator so I could be doing something wrong as well.
> >
> >Anyway from all the examples that I have seen, and postings on the list,
> >this is how to define a validator for a form/field:
> >
> ><form name="testForm">
> >	<field property="name"
> >   	       depends="required">
> >	<arg0 key="testform.name"/>
> >	</field>
> >	<field property="value"
> >		depends="required">
> >	<arg0 key="testform.value"/>
> >	</field>
> ></form>
> >
> >Now, validation DOES happen, however the message keys (and I only have
> one
> >bundle) "testform.name" and "testform.value" are not used when a
> validation
> >occurs. Instead I get: "null is required". The only way I was able to get
> >the proper message key to work, was to specify the arg* elements like
> this:
> >
> >	<arg0 name="required" key="testform.name"/>
> >
> >In other words, I have to reference the validator name being used in the
> >arg* in order for the message to resolve. This is something that I
> haven't
> >seen mentioned anywhere in the existing documentation, books, or on the
> >list. Is it a bug or a new requirement? This happens with all Validator
> >form
> >types, and my own "Dyna" form class.
> >
> >Thanks,
> >John
> >
> >
> >
> >This communication is intended for the use of the individual(s) or entity
> >it
> >was addressed to and may contain confidential and/or privileged
> >information.
> >If the reader of this transmission is not the intended recipient, you are
> >hereby notified that any review, dissemination, distribution or copying
> of
> >this communication is prohibited.  If you receive this communication in
> >error, please notify the sender immediately and delete this communication
> >from your system(s) to which it was sent and/or replicated to. (c) 2003
> >Sapiens Americas Corp.
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
> 
> _________________________________________________________________
> Help STOP SPAM with the new MSN 8 and get 2 months FREE*
> http://join.msn.com/?page=features/junkmail
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org



This communication is intended for the use of the individual(s) or entity it
was addressed to and may contain confidential and/or privileged information.
If the reader of this transmission is not the intended recipient, you are
hereby notified that any review, dissemination, distribution or copying of
this communication is prohibited.  If you receive this communication in
error, please notify the sender immediately and delete this communication
from your system(s) to which it was sent and/or replicated to. (c) 2003
Sapiens Americas Corp.

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org