Assuming you meant that you want to add errors in the Action, rather than
the ActionForm, in your Action...

  1. Create an empty ActionErrors object.  Let's call it "errors".
  2. Add messages to it as necessary (e.g. errors.add("propertyName"
  ,new ActionMessage("msg.key"));)
  3. Then call the base class method saveErrors(request, errors);


On 7/11/06, Laurie Harper <[EMAIL PROTECTED]> wrote:

chamal desilva wrote:
> Hi,
>
> I want store all messages in a properties file called
> MessageProperties.
>
> I added this line to struts config file.
> <message-resources key="messages"
> parameter="arweb.resources.MessageResources"></message-resources>
>
> How can I retireve values in properties file from my
> action classes in order to display them using
> </html:errors> tag.

Use getResources(request, key), where 'key' is "messages", to match your
struts-config entry.


http://struts.apache.org/1.2.9/api/org/apache/struts/action/Action.html#getResources(javax.servlet.http.HttpServletRequest,%20java.lang.String)

L.


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


Reply via email to