struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hanmay Udgiri" <hanmayya.udg...@gmail.com>
Subject Re: Query in action messages
Date Wed, 15 Nov 2006 09:39:27 GMT
Hi Nuwan,
Actually I am using Form and this method is available in Action class

On 11/15/06, Nuwan Chandrasoma <mymailnot@gmail.com> wrote:
>
> Ops..,, sorry ignore the last mail..
>
> It should be.. first call the getResources() and get the MessageResource
> and
> from there u can get the message..
>
> eg:-
>
> errors.add(Error_FIELD_KEY,new ActionMessage("
> error.required",getResources(request).getMessage("error.zipcode"));
>
> Regards,
>
> Nuwan
>
>
>
> ----- Original Message -----
> From: "Hanmay Udgiri" <hanmayya.udgiri@gmail.com>
> To: <user@struts.apache.org>
> Sent: Wednesday, November 15, 2006 8:25 AM
> Subject: Query in action messages
>
>
> > Hi
> > I am doing validation in my Action Form which is extending
> > ValidatorActionForm.
> > In validate method,I am checking for mandatory field and adding error.
> > The error in ApplicationResources.properties is like this.
> > error.required=The {0) field is required field.
> > error.notInRange=The {0} field should be in between {1) and {2)
> > error.zipcode=Zip Code
> > And I am addding the the error in validate mehod like this
> > errors.add(Error_FIELD_KEY,new ActionMessage(" error.required","
> > error.zipcode"));
> >
> > But It is printing the error mesasges like this.
> > The error.zipcode field in reuqired field.
> > It works if I add error like this.
> > errors.add(Error_FIELD_KEY,new ActionMessage(" error.required","Zip
> > Code"));
> > The Zip Code field in reuqired field.
> >
> > Can anybody help on this
> >
> > --
> > Thanks and Regards
> > Hanmayya Udgiri
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Thanks and Regards
Hanmayya Udgiri

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message