Skip to content

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

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

Closed
spring-projects-issues opened this issue Apr 13, 2017 · 1 comment
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues 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:

Referenced from: commits cec36fe, 421fabb

@spring-projects-issues
Copy link
Collaborator Author

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
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants