You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Michael Osipov (JIRA)" <de...@velocity.apache.org> on 2010/08/20 16:56:16 UTC

[jira] Commented: (VELTOOLS-127) Request-scoped tool locale does not change when request locale changes

    [ https://issues.apache.org/jira/browse/VELTOOLS-127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12900717#action_12900717 ] 

Michael Osipov commented on VELTOOLS-127:
-----------------------------------------

Referencing $display gives me a different address in memory, this means that the tool is recreated but the locale not set.

> Request-scoped tool locale does not change when request locale changes
> ----------------------------------------------------------------------
>
>                 Key: VELTOOLS-127
>                 URL: https://issues.apache.org/jira/browse/VELTOOLS-127
>             Project: Velocity Tools
>          Issue Type: Bug
>          Components: GenericTools
>    Affects Versions: 2.0
>            Reporter: Michael Osipov
>            Priority: Critical
>
> I am using the VelocityViewServlet to display some templates and JAXB stuff. As far as I understand, all tools which extend LocaleConfig will have the locale set by request.getLocale().
> Well, this does seem to be the case for the for set and not subsequent ones.
> I have the following tools.xml
> {code}
> <tools>
> 	<toolbox scope="application">
> 		
> 	</toolbox>
> 	<toolbox scope="request">
> 		<tool class="org.apache.velocity.tools.view.ViewContextTool" />
> 		<tool class="org.apache.velocity.tools.generic.DisplayTool" />
> 	</toolbox>
> </tools>
> {code}
> And this in my template:
> $display.locale
> $request.locale
> While tampering my locale with Quick Locale Switcher in Firefox. Request locale is correct but display locale remains the same.
> This is really weird since the tool is recreated and every request otherwise the localeconfig is useless.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org