question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Spring MVC's locale resolver can no longer be customized in parent context

See original GitHub issue

Affects: 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:closed
  • Created 3 years ago
  • Comments:40 (20 by maintainers)

github_iconTop GitHub Comments

2reactions
schuchcommented, Nov 9, 2020

@schuch Feel free to test on your side with the latest 5.3.1-SNAPSHOT.

Tested successfully with 5.3.1-SNAPSHOT 🥳

2reactions
PiotrTraczynskicommented, Nov 4, 2020

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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found