Or if you just need a String value from the MessageResources you can
use:
String sValue = getResources(request).getMessage(locale, "key.value");
Gary
>>> [EMAIL PROTECTED] 5/18/2006 9:11:01 AM >>>
You would have to be more specific in your question. Do you mean
ActionMessage or just the message in your properties file etc.
You might want to check out the ActionMessages and the ActionMessage
class. Also, Validator and ValidatorAction classes in Commons
Validator.
Here's a really simple way to access the ActionMessages object from
Java
code.
ActionMessages errors = ((YourForm)form).validate(mapping, request);
if(errors != null && errors.isEmpty())
{
//String temp =
(String)request.getAttribute("toPageName");
return mapping.findForward("success");
}
else
{
saveErrors(request, errors);
return mapping.findForward("failure");
}
Harsh.
-----Original Message-----
From: fea jabi [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 18, 2006 8:57 AM
To: [email protected]
Subject: get message from MessageResources in Action Class
Using struts 1.2.7
How to get the message from MessageResource in the Action Class?
Thanks.
_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar - get it now!
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_______________________________________________________________
Confidentiality Statement:
This email/fax, including attachments, may include confidential
and/or proprietary information and may be used only by the
person or entity to which it is addressed. If the reader of
this email/fax is not the intended recipient or his or her
agent, the reader is hereby notified that any dissemination,
distribution or copying of this email/fax is prohibited. If you
have received this email/fax in error, please notify the sender
by replying to this message and deleting this email or
destroying this facsimile immediately.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]