Patrice and Sven, thank you very much!! You are very helpful.
Have a good day.
Cathy
Patrice <[EMAIL PROTECTED]> wrote: Hi Cathy,
You can use 4 dynamic data at the maximum, in an error message. The values
can be defined in the ActionError constructor:
errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("error.myError",
dynamicValue1, dynamicValue2, dynamicValue3, dynamicValue4));
and in you resources file:
error.myError=blah blah {0} blah blah {1} {2} blah{3}
{0}, {1}, {2} and {3} will be replaced with the contents of dynamicValue1,
dynamicValue2, dynamicValue3, and dynamicValue4.
Best regards
Patrice
----- Original Message -----
From: "Cathy Osekizoglu"
To: "Struts Users Mailing List"
Sent: Thursday, November 28, 2002 9:10 PM
Subject: Re: display error message including dynamic data
>
> Hi, Patrice:
> That works. Thank you so much!
> One more question. If I have two or more dynamic data which I want to
display them in the error message. How can I achieve that using the above
approach?
> Thank you.
> Cathy
>
> Patrice
wrote:Hi,
>
> You can specify dynamic data in your errors like this:
> errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("error.amount",
> dynamicAmount));
> where dynamicAmount contains the amount you want to display in your error
> message.
>
> In your ApplicationResource.properties:
> error.amount=you can't retrieve more that {0} dollars
>
> {0} will be replaced by the content of dynamicAmount.
>
> Hope it helps
> Patrice
>
> ----- Original Message -----
> From: "Cathy Osekizoglu"
> To: "Struts Users Mailing List"
> Sent: Thursday, November 28, 2002 8:12 PM
> Subject: display error message including dynamic data
>
>
> >
> > Hi:
> > According to the result from my action class, I need to display message
to
> user using the dynamic data.
> > This is what I am doing: In my action class, I got the result that user
> can only retrieve maximum 50 dollars from his credit card. When user try
to
> retrieve more than 50 dollars, I want to display the error message: " you
> can't retrieve more that 50 dollars". (50 is dynamic data here). In my
> action class, I have errors.add(ActionErrors.GLOBAL_ERROR, new
> ActionError("error.amount")); in my Jsp, I have . How can I
> achieve it in ApplicationResource.properties?(I am using struts1.1-b2).
> > Thank you very much for your reply
> >
> >
> >
> > ---------------------------------
> > Post your free ad now! Yahoo! Canada Personals
> >
>
>
> --
> To unsubscribe, e-mail:
> For additional commands, e-mail:
>
>
>
> ---------------------------------
> Post your free ad now! Yahoo! Canada Personals
>
--
To unsubscribe, e-mail:
For additional commands, e-mail:
---------------------------------
Post your free ad now! Yahoo! Canada Personals