Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-2533

Behavior for accepted locales should fit the HTTP Specification

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.4.1
    • 1.4.4, 1.5-M1
    • wicket
    • None
    • all

    Description

      I try to filter the locales assignable to session on newSession(request, response) in application. The testcase is simple:
      If application supports locale accepted by user client (http-header "accepted-language") then i assign it to session, otherwise
      i use the application default.

      But the behavior differs to production system. MockHttpRequest.getLocales returns only one locale. But the implementation
      used in production system (org.apache.catalina.connector.RequestFacade) provides all locales contained in header.
      So my testcase is working in production but not in test.

      As an extension to this it COULD be a simplification if application could support query to application supported languages.
      Normally this is a decision which is made at design time. So if you develop the application you know the supported languages.
      So it would be great if there would be a place where i can query these easily (extension to settings?).

      We had two discussions on that in mailing-list:
      http://www.nabble.com/Howto-accept-other-then-first-locale-in-HTTP-header-%22Accept-Language%22--to25922534.html
      http://www.nabble.com/Wickettester-change-locale-of-request-to25907133.html

      Specification is here
      http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4

      Attachments

        Activity

          People

            jdonnerstag Juegen Donnerstag
            newgro Per Newgro
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: