Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make SessionLocaleResolver's attribute name configurable [SPR-15450] #20011

Closed
spring-issuemaster opened this issue Apr 13, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@spring-issuemaster
Copy link
Collaborator

commented Apr 13, 2017

Mercy Ma opened SPR-15450 and commented

I used org.springframework.web.servlet.i18n.SessionLocaleResolver to resolve LocaleContext , and found the attribute name of HttpSession is a constant value ( String LOCALE_SESSION_ATTRIBUTE_NAME = SessionLocaleResolver.class.getName() + ".LOCALE";) , and it still can't be changed in latest version of Spring WebMVC, thus , Is possible to change the attribute name of HttpSession for SessionLocaleResolver ?


Affects: 4.3.7

Reference URL: https://github.com/spring-projects/spring-framework/blob/master/spring-webmvc/src/main/java/org/springframework/web/servlet/i18n/SessionLocaleResolver.java

Issue Links:

  • #19748 CookieLocaleResolver may disturb error rendering when locale cookie has a malformed value
  • #19987 Revise AcceptHeaderLocaleResolver default locale handling

Referenced from: commits cec36fe, 421fabb

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Apr 13, 2017

Juergen Hoeller commented

Good point! I've introduced corresponding setLocaleAttributeName and setTimeZoneAttributeName methods on SessionLocaleResolver, allowing for customization, and will backport those to 4.3.8 as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.