You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ted Husted <hu...@apache.org> on 2006/09/18 12:37:47 UTC

Re: Accessing ApplicationResources in Action class (AFTER changing locale)

What is the idiom for obtaining the message from other than the
default (English bundle).

If I change the locale to "es", the tags work fine, but I can't seem
to access it from the Actoin.

        MessageResources resources =
getResources(request,getLocale(request).toString());

Returns null for me.

-Ted.


On 6/13/06, Frank W. Zammetti <fz...@omnytex.com> wrote:
> Hi Pankaj,
>
> This is the code I use when I need to get a resource string in an Action:
>
> String text = getResources(request).getMessage(getLocale(request),
> "messages.deleteFailed");
>
> HTH,
> Frank
>
> Pankaj Gupta wrote:
> > Hi,
> >
> > Can anyone please suggest how can I access
> > ApplicationResources.properties from my Action class. Specifically I
> > want to read the labels for my LabelValueBean object  from the
> > application  resources.
> >
> > regards,
> > Pankaj
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
> >
> > .
> >
>
> --
> Frank W. Zammetti
> Founder and Chief Software Architect
> Omnytex Technologies
> http://www.omnytex.com
> AIM: fzammetti
> Yahoo: fzammetti
> MSN: fzammetti@hotmail.com
> Java Web Parts -
> http://javawebparts.sourceforge.net
> Supplying the wheel, so you don't have to reinvent it!
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
HTH, Ted.
* http://www.husted.com/struts/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org