You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ray Clough <ra...@allthisisthat.com> on 2007/06/26 04:00:39 UTC

S2 - How do I ...

How do I get the Struts properties from within my application.  What I am
looking for is to read the property "struts.custom.i18n.resources", which is
defined in the 'struts.properties' file, so that I can get the
ResourceBundle names.  I guess that there is a Struts Properties object
which can be referenced and read, the question is how.

Also, although this is not a Struts question, how do I resolve the suffix on
a ResourceBundle to the language name?

Thanks,
- Ray Clough
-- 
View this message in context: http://www.nabble.com/S2---How-do-I-...-tf3980139.html#a11298949
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: S2 - How do I ...

Posted by Laurie Harper <la...@holoweb.net>.
Ray Clough wrote:
> How do I get the Struts properties from within my application.  What I am

Depends which version of Struts you're using.

> looking for is to read the property "struts.custom.i18n.resources", which is
> defined in the 'struts.properties' file, so that I can get the
> ResourceBundle names.  I guess that there is a Struts Properties object
> which can be referenced and read, the question is how.

For Struts 1, use the Action.getResources() methods to get the resource 
bundle, then retrieve the specific property you want from that.

For Struts 2, use the ActionSupport.getText() methods to retrieve the 
property directly.

> Also, although this is not a Struts question, how do I resolve the suffix on
> a ResourceBundle to the language name?

I'm not sure what you mean. Usually, you take a resource bundle name and 
a locale to locate the most locale-specific resource bundle. Are you 
trying to derive a locale from a resource bundle file name?

L.


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