You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by chamal desilva <ch...@yahoo.com> on 2006/12/22 05:13:46 UTC

Accessing Application Resources file

Hi,

I want to retireve a message from application
resources file.

This is my code..

resources
=(MessageResources)pageContext.getRequest().getAttribute(
Action.MESSAGES_KEY );

format  = (String)
resources.getMessage("display.currency" );

This works fine. But only issue is that
Action.MESSAGES_KEY is deprecated.

Is there a much standard way to do this.

Thanking you,
Chamal.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Re: Accessing Application Resources file

Posted by Nuwan Chandrasoma <my...@gmail.com>.
Hi,

In your action class you can get the resources by using getResources() 
method

eg:-

getResources(request).getMessage("name");


Thanks,

Nuwan.


----- Original Message ----- 
From: "chamal desilva" <ch...@yahoo.com>
To: <us...@struts.apache.org>
Sent: Friday, December 22, 2006 4:13 AM
Subject: Accessing Application Resources file


> Hi,
>
> I want to retireve a message from application
> resources file.
>
> This is my code..
>
> resources
> =(MessageResources)pageContext.getRequest().getAttribute(
> Action.MESSAGES_KEY );
>
> format  = (String)
> resources.getMessage("display.currency" );
>
> This works fine. But only issue is that
> Action.MESSAGES_KEY is deprecated.
>
> Is there a much standard way to do this.
>
> Thanking you,
> Chamal.
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 


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