There is a better way to do this from within your action class
perform/execute method.

        MessageResources messages = getResources(request);

It is faster because it is stored in memory.
(see org.apache.struts.action.Action for details)

James Mitchell
Software Engineer\Struts Evangelist
Struts-Atlanta, the "Open Minded Developer Network"
http://www.open-tools.org/struts-atlanta




> -----Original Message-----
> From: Andy [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 22, 2002 1:02 AM
> To: Struts Users Mailing List
> Subject: Re: Can I read internationalized messages in Action classes ?
>
>
> hi, Anjana
> try this:
> org.apache.struts.util.MessageResources.getMessageResources("FileN
> ame").getM
> essage(key);
> or
> org.apache.struts.util.MessageResources.getMessageResources("FileN
> ame").getM
> essage(key, arg);
>
> FileName: xxx.xxx.xxx.ApplicationResources
> (same messages property file)
>
> Andy
>
> ----- Original Message -----
> From: "Anjana Wijayaweera" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Monday, July 22, 2002 1:43 PM
> Subject: Can I read internationalized messages in Action classes ?
>
>
> >
> > Hi All,
> >
> > I need to know how to read internationalized messages inside action
> > classes If
> > possible I would like to load it from the same messages property file as
> the
> > one
> > <bean:message /> loads it from.
> >
> > For instance how would I internationalize this message "Session Cleanup:
> > sessionData removed from session"
> > in the following line of code.
> >
> >      log(Constants.ERROR_DEBUG,
> >                     "Session Cleanup: sessionData removed from
> session");
> >
> > Thanks in advance for your help :o)
> >
> >
> > Regards,
> > Anjana
> > --
> > To unsubscribe, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> >
> >
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>



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

Reply via email to