You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Andrei Ivanov <an...@gmail.com> on 2009/02/02 13:59:03 UTC

Re: stack values in converter

Anybody?

On Tue, Jan 20, 2009 at 10:30 AM, Andrei Ivanov <an...@gmail.com> wrote:
> On Tue, Jan 20, 2009 at 5:08 AM, dusty <du...@yahoo.com> wrote:
>>
>> Sorry.  I don't think I understand your problem.  When you say the stack is
>> being cleared are you seeing nulls in your converter for values that were
>> previously populated on the stack by the Parameters Interceptor?
> No
>
> My interceptors stack is like this:
> I18nInterceptor
> ...
> ParamtersInterceptor
> ...
>
> The I18nInterceptor does invocation.getInvocationContext().setLocale(locale);
>
> The ParamtersInterceptor calls my DateConverter.
> My DateConverter does Locale locale = (Locale)
> context.get(ActionContext.LOCALE);
> With xwork > 2.0.5, locale is null
> Is there any other way to get the current locale from a converter?
>
>>
>>
>>
>> Andrei Ivanov-2 wrote:
>>>
>>> On Sat, Jan 17, 2009 at 7:30 PM, Andrei Ivanov <an...@gmail.com>
>>> wrote:
>>>> Hello,
>>>> I have a date converter that does something like this:
>>>>
>>>> String value = values[0];
>>>> Locale locale = (Locale) context.get(ActionContext.LOCALE);
>>>> DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT, locale);
>>>> Date date = df.parse(value);
>>>>
>>>> The locale is set in the context by the
>>>> com.opensymphony.xwork2.interceptor.I18nInterceptor
>>>>
>>>> After upgrading struts and xwork it seems this code doesn't work
>>>> anymore, because of the changes
>>>> made in ParametersInterceptor, which clear the stack values (begining
>>>> with "boolean clearableStack = newStack instanceof
>>>> ClearableValueStack;")
>>>>
>>>> What can I do to make it work again?
>>>>
>>>> Thank you
>>>>
>>>
>>> Anyone?

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


Re: stack values in converter

Posted by Andrei Ivanov <an...@gmail.com>.
On Mon, Feb 2, 2009 at 4:18 PM, Musachy Barroso <mu...@gmail.com> wrote:
> This is a known problem on xwork 2.1.2:
>
> http://jira.opensymphony.com/browse/XW-670
>
> it is fixed in xwork trunk
>
AFAIS, struts 2.0 uses xwork 2.0
How will it help me that it will be fixed in xwork 2.1?

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


Re: stack values in converter

Posted by Musachy Barroso <mu...@gmail.com>.
This is a known problem on xwork 2.1.2:

http://jira.opensymphony.com/browse/XW-670

it is fixed in xwork trunk

musachy

On Mon, Feb 2, 2009 at 7:59 AM, Andrei Ivanov <an...@gmail.com> wrote:
> Anybody?
>
> On Tue, Jan 20, 2009 at 10:30 AM, Andrei Ivanov <an...@gmail.com> wrote:
>> On Tue, Jan 20, 2009 at 5:08 AM, dusty <du...@yahoo.com> wrote:
>>>
>>> Sorry.  I don't think I understand your problem.  When you say the stack is
>>> being cleared are you seeing nulls in your converter for values that were
>>> previously populated on the stack by the Parameters Interceptor?
>> No
>>
>> My interceptors stack is like this:
>> I18nInterceptor
>> ...
>> ParamtersInterceptor
>> ...
>>
>> The I18nInterceptor does invocation.getInvocationContext().setLocale(locale);
>>
>> The ParamtersInterceptor calls my DateConverter.
>> My DateConverter does Locale locale = (Locale)
>> context.get(ActionContext.LOCALE);
>> With xwork > 2.0.5, locale is null
>> Is there any other way to get the current locale from a converter?
>>
>>>
>>>
>>>
>>> Andrei Ivanov-2 wrote:
>>>>
>>>> On Sat, Jan 17, 2009 at 7:30 PM, Andrei Ivanov <an...@gmail.com>
>>>> wrote:
>>>>> Hello,
>>>>> I have a date converter that does something like this:
>>>>>
>>>>> String value = values[0];
>>>>> Locale locale = (Locale) context.get(ActionContext.LOCALE);
>>>>> DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT, locale);
>>>>> Date date = df.parse(value);
>>>>>
>>>>> The locale is set in the context by the
>>>>> com.opensymphony.xwork2.interceptor.I18nInterceptor
>>>>>
>>>>> After upgrading struts and xwork it seems this code doesn't work
>>>>> anymore, because of the changes
>>>>> made in ParametersInterceptor, which clear the stack values (begining
>>>>> with "boolean clearableStack = newStack instanceof
>>>>> ClearableValueStack;")
>>>>>
>>>>> What can I do to make it work again?
>>>>>
>>>>> Thank you
>>>>>
>>>>
>>>> Anyone?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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