Thank you both for your help. I got this working with your suggestions. :) I made an experiment with various ways of working this out. Here are the results. They may be helpful to others looking for the same answer.
1. Doesn't work name('Locale.US'): <s:property value="name('Locale.US')" /> 2. Doesn't work name(Locale.US): <s:property value="name(Locale.US)" /> 3. Doesn't work getName(Locale.US): <s:property value="getName(Locale.US)" /> 4. Works. notice the ' in the parameter getName('Locale.US'): <s:property value="getName('Locale.US')" /> 5. Works. i tried something similar before but I was just using 'name' instead of 'getName' getName(@java.util.loc...@us): <s:property value="getName(@java.util.loc...@us)" /> 6. Doesn't wok. I tried this previously. See nº5 name(@java.util.loc...@us): <s:property value="name(@java.util.loc...@us)" /> 7. Works but probably only because there is also a getName(String s) where s is the locale as a string name('en_US'): <s:property value="getName('en_US')" /> 8. Works but probably only because there is also a getName(String s) where s is the locale as a string name('US'): <s:property value="getName('US')" /> Also, I did not need to use struts.ognl.allowStaticMethodAccess ------------- > > i still think you should be looking at this differently and using the i18n interceptor and resource bundles to handle different > languages. @adam: I'm using Liferay and this is a class provided by the Portal to get the names of the pages in localized format. The getName method (without parameters) returns XML content with the various languages so I need to get the right locale using the provided getName(Locale locale). Perhaps I could create an additional class where I would store the information I need in an already localized format and handle this in the Action. Best Regards, Ricardo 2010/3/4 adam pinder <apin...@hotmail.co.uk> > > > > just pass an alias to the locale in the parameter > > > > <s:property value="getName('US')"/> > > > > and let the getName class handle the actual locale. > > > > adam > > > Date: Thu, 4 Mar 2010 18:20:19 +0100 > > Subject: Re: Passing parameters to <s:property> > > From: lukasz.len...@googlemail.com > > To: user@struts.apache.org > > > > 2010/3/4 Ricardo Jorge <rvjs...@gmail.com>: > > > PS: I've just tried the following but it did not work > > > <s:property value="name(@java.util.loc...@us)" /> > > > > Take a look on some examples here [1] and try > > <s:property value="getName(@java.util.loc...@us)" /> > > > > [1] http://struts.apache.org/2.x/docs/ognl-basics.html > > > > > > Regards > > -- > > Łukasz > > http://www.lenart.org.pl/ > > Kapituła Javarsovia 2010 > > http://javarsovia.pl > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > > For additional commands, e-mail: user-h...@struts.apache.org > > > > _________________________________________________________________ > Tell us your greatest, weirdest and funniest Hotmail stories > http://clk.atdmt.com/UKM/go/195013117/direct/01/ >