Uploaded image for project: 'Velocity Tools'
  1. Velocity Tools
  2. VELTOOLS-127

Request-scoped tool locale does not change when request locale changes

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Not A Problem
    • 2.0
    • None
    • GenericTools
    • None

    Description

      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

      <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>
      

      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.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            michael-o Michael Osipov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment