If you want to get MessageResources in your validate method then you can
just do:

MessageResources messages = ((MessageResources)
request.getAttribute(Globals.MESSAGES_KEY));


and that should do the trick.


----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, May 21, 2004 3:45 PM
Subject: Message Resources


> Greetings,
>
> The following code snippet is from my ActionForm.validate() method.
> What I don't like and wonder if there is a better way to this: is the
> loading of the Message Resources.
> I need to do this to get a value that is passed as a parameter to a
> message.
>
> private static MessageResources messages =
> MessageResources.getMessageResources("resources.ApplicationResources");
>
> errors.add(ActionErrors.GLOBAL_ERROR, new
> ActionMessage("errors.general.alphabetic.required",
> messages.getMessage(hrOnlineLocale.getLocaleLocale(),
> "label.first.name")));
>
> Is there a better way to do this?
>
> TIA,
> Glenn



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to