struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Monkeyden <monkey...@gmail.com>
Subject Re: Using properties files other than ApplicationProperties
Date Tue, 11 Jul 2006 22:15:31 GMT
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 <laurie@holoweb.net> 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: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message