Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-13505

Improve documentation about CookieLocaleResolver vs SessionLocaleResolver

    Details

    • Type: Task
    • Status: Closed
    • Priority: Trivial
    • Resolution: Complete
    • Affects Version/s: 4.2 GA
    • Fix Version/s: 4.2.3
    • Component/s: [Documentation]
    • Labels:
      None
    • Last commented by a User:
      true

      Description

      Hello

      In the Reference Documentation, for the section "21.8. Using locales"
      Where I can see the sub sections:

      21.8.4. SessionLocaleResolver
      21.8.5. LocaleChangeInterceptor

      Just curious if is possible add a note about when use each approach, advantages and disadvantages for each one.

      If exists some relation or impact about "SessionLocaleResolver" for Spring Session and Spring Cloud.

      Thanks.

        Activity

        Hide
        juergen.hoeller Juergen Hoeller added a comment - - edited

        I've added a note on SessionLocaleResolver: In contrast to CookieLocaleResolver, this strategy stores locally chosen locale settings in the Servlet container's HttpSession. As a consequence, those settings are just temporary for each session and therefore lost when each session terminates.

        There is no direct relationship with Spring Session. Our SessionLocaleResolver will simply evaluate and modify corresponding HttpSession attributes against the current HttpServletRequest.

        Juergen

        Show
        juergen.hoeller Juergen Hoeller added a comment - - edited I've added a note on SessionLocaleResolver: In contrast to CookieLocaleResolver, this strategy stores locally chosen locale settings in the Servlet container's HttpSession. As a consequence, those settings are just temporary for each session and therefore lost when each session terminates. There is no direct relationship with Spring Session. Our SessionLocaleResolver will simply evaluate and modify corresponding HttpSession attributes against the current HttpServletRequest. Juergen
        Hide
        dr_pompeii Manuel Jordan added a comment - - edited

        Hi Juergen

        Thanks by the valuable explanation. I think your two paragraphs should be added in the Reference Documentation. As well how in the API too.

        Kind Regards

        -Manuel

        Show
        dr_pompeii Manuel Jordan added a comment - - edited Hi Juergen Thanks by the valuable explanation. I think your two paragraphs should be added in the Reference Documentation. As well how in the API too. Kind Regards -Manuel

          People

          • Assignee:
            juergen.hoeller Juergen Hoeller
            Reporter:
            dr_pompeii Manuel Jordan
            Last updater:
            St├ęphane Nicoll
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Days since last comment:
              2 years, 17 weeks, 3 days ago