struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Wang" <ddw...@anomaly.net>
Subject Re: newbie validator question: show value of a field in error
Date Tue, 16 Sep 2003 09:56:03 GMT
I could certainly do this by hand in the validate() method of the form or in
the action (which I have been doing this for the last few months), but I was
hoping the validator could do it for me somehow...

or maybe I misunderstood you?  obviously concatenating strings would be
"bad" due to i18n.

daniel

----- Original Message ----- 
From: "Naveen Mudgal" <naveen.m@consulting.stgintl.com>
To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
Sent: Tuesday, September 16, 2003 2:50 AM
Subject: RE: newbie validator question: show value of a field in error


> u catch the username field value using <bean:write> tag and concatenate
the error message defined in applicationresources.properties file
errors.email={0} is not a valid email address.
>
>
>
> -----Original Message-----
> From: Daniel Wang [mailto:ddwang@anomaly.net]
> Sent: Tuesday, September 16, 2003 3:13 PM
> To: Struts Users Mailing List
> Subject: newbie validator question: show value of a field in error
>
>
> I have a dumb question re: struts validator:
>
> How do I show the value of the offending field in the error message as
> opposed to the field name?
>
> i.e. if the field I want to validate is email, and the user types in
"foo",
> how do I show
> "'foo' is not a valid email address"
>
> as opposed to the more standard (or widely documented) error
> "'Email Address' is not valid"
>
> Thanks,
> Daniel
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>


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


Mime
View raw message