struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Rodriguez Lopez <alo...@flordeutopia.pt>
Subject Re: Locale and custom variables
Date Thu, 04 Mar 2010 14:23:47 GMT
Em 04-03-2010 14:15, abhishek jain escreveu:
> On Thu, Mar 4, 2010 at 7:30 PM, Alex Rodriguez Lopez<alopez@flordeutopia.pt
>> wrote:
>
>> Em 04-03-2010 05:49, abhishek jain escreveu:
>>
>> Hi friends,
>>>
>>> I have a few variables who have diff values depending on the locale /
>>> country.
>>> I do want to use a message-resources for storing the values of those
>>> varaibles,
>>> I do not know how to get these variables in my Action (I want them in
>>> action
>>> and not jsp),
>>> Can any one help,
>>> I have tried System.out.println(getResources(request,"id2")); after
>>> setting
>>> a locale and it do not work.
>>>
>>> Pl. help,
>>> --
>>> Thanks and kind Regards,
>>> Abhishek jain
>>>
>>>
>> Hi Abhishek,
>>
>> if your Action extends ActionSupport, you can use one of the getText()
>> methods to do preciselly this, check
>> http://struts.apache.org/2.1.8.1/struts2-core/apidocs/com/opensymphony/xwork2/ActionSupport.html.
>>
>> We use it this way around here and it works fine (the resource properties
>> files being in the same package).
>>
>> Regards,
>>
>> Alex
>
>
> Dear Alex,
> Thanks will check that
> PS: Will it work for Struts 1.2 as well?

sorry I didn't get that you where using struts 1
struts 1 actions don't extend the same kind of class, you where already 
doing right with getResources, I think it should work

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


Mime
View raw message