Spring MVC's locale resolver can no longer be customized in parent context
See original GitHub issueAffects: 5.3 snapshots
The fix for #25209 appears to have removed or at least limited the ability to customize the locale resolver that is used by the DispatcherServlet
.
The introduction of a default LocaleResolver
bean means that Spring Boot’s auto-configuration of a LocaleResolver
backs off as it is presumed that the bean that’s now present is one provided by the user. This means that the spring.mvc.locale
and spring.mvc.locale-resolver
properties are no longer honoured.
This change will also break any Spring Boot user who has defined their own localeResolver
bean as it would attempt to override the bean defined by WebMvcConfigurationSupport
. This will fail as bean definition overriding is disabled by default in Boot.
Issue Analytics
- State:
- Created 3 years ago
- Comments:40 (20 by maintainers)
Top Results From Across the Web
how to override the LocaleContext in Spring MVC
I've set up a custom localeResolver, which works okay so far. But I'm not sure how to customise the locale context itself. I...
Read more >SessionLocaleResolver example. - LogicBig
Spring MVC - Customized Locale selection using SessionLocaleResolver · A user selects a desired language from a dropdown component on the client ...
Read more >17. Web MVC framework - Spring
framework is designed around a DispatcherServlet that dispatches requests to handlers, with configurable handler mappings, view resolution, locale and theme ...
Read more >Spring WebFlux Tutorial on Internationalization | Phrase
FixedLocaleContextResolver : always returns a fixed locale and optionally time zone. In this article, we will try to implement a custom ...
Read more >Spring Web Contexts - Baeldung
If we manually set its parent, then Spring does not override our decision, and this section no longer applies. In simpler MVC applications, ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Tested successfully with
5.3.1-SNAPSHOT
🥳Solution at: https://github.com/spring-projects/spring-framework/wiki/Upgrading-to-Spring-Framework-5.x#spring-mvc do not work. there is still override error. How to customize LocalResolver?