You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Arash Bijanzadeh <ar...@gmail.com> on 2005/06/21 10:44:12 UTC
Accessing message resource from in validate method
Hi,
In the validate method of ActionForm, I need to access the resource messages
to pass the message as arg to ActionMessage constructor.
Could anybody help me?
Re: Accessing message resource from in validate method
Posted by Arash Bijanzadeh <ar...@gmail.com>.
My problem is creating a message with an argument for example:
Date {0} is not valid.
I create:
msg.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("errors.badDate"));
My Question : how can I add the argument for {0} from resource bundle to
this statement, as validator framewoek does?
Regards,
arash
On 6/21/05, Jana Parvanova <ja...@sirma.bg> wrote:
>
> ActionMessage is constructed with message key, not with message text - so
> you don't have to access resources directly.
> Or, maybe I have not understood your question?
>
> ----- Original Message -----
> From: "Arash Bijanzadeh" <ar...@gmail.com>
> To: <us...@struts.apache.org>
> Sent: Tuesday, June 21, 2005 11:44 AM
> Subject: Accessing message resource from in validate method
>
>
> Hi,
> In the validate method of ActionForm, I need to access the resource
> messages
> to pass the message as arg to ActionMessage constructor.
> Could anybody help me?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
Re: Accessing message resource from in validate method
Posted by Jana Parvanova <ja...@sirma.bg>.
ActionMessage is constructed with message key, not with message text - so
you don't have to access resources directly.
Or, maybe I have not understood your question?
----- Original Message -----
From: "Arash Bijanzadeh" <ar...@gmail.com>
To: <us...@struts.apache.org>
Sent: Tuesday, June 21, 2005 11:44 AM
Subject: Accessing message resource from in validate method
Hi,
In the validate method of ActionForm, I need to access the resource messages
to pass the message as arg to ActionMessage constructor.
Could anybody help me?
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org