You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Legolas Woodland <le...@gmail.com> on 2006/01/28 12:58:17 UTC

How to access string resources (.properties entries) from inside a servlet ?

Hi
Thank you for reading my post.
how i can retrieve some string resources from my bundle.properties  file?
the file is located in : *servlet/bundle.properties*
I want to retrieve some of its key and use them inside the servlet java 
file.

AW: How to access string resources (.properties entries) from inside a servlet ?

Posted by Martin Kindler <ki...@arcor.de>.
Look at the org.apache.struts.util.MessageResources class. It has a method
getMessage(Locale, String) which retrieves the resource.

You can get the instance of the MessageResources from the request in your
Struts action. It has the key "org.apache.struts.action.MESSAGE".

Martin

> -----Ursprüngliche Nachricht-----
> Von: Legolas Woodland [mailto:legolas.w@gmail.com] 
> Gesendet: Samstag, 28. Januar 2006 12:58
> An: Struts Users Mailing List
> Betreff: How to access string resources (.properties entries) 
> from inside a servlet ?
> 
> 
> Hi
> Thank you for reading my post.
> how i can retrieve some string resources from my 
> bundle.properties  file? the file is located in : 
> *servlet/bundle.properties* I want to retrieve some of its 
> key and use them inside the servlet java 
> file.
> 



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