title: Spring LocalResolver based on query parameter 'lang=en'?
body: <p>Can I tell <code>spring-boot</code> to automatically resolve the requested <code>locale</code> by a queryparameter, eg <code>&amp;lang=en</code>?</p>
  
  <p>I would like to give the query param precedence over <code>Accept-Language</code> parameter.</p>
  
  <p>I found the following two properties, but nothing about a query param.</p>
  
  <pre><code>spring.mvc.locale= # Locale to use. By default, this locale is overridden by the "Accept-Language" header.
  spring.mvc.locale-resolver=accept-header # Define how the locale should be resolved.
  </code></pre>
  
  <p>I tried as follows, which gives an exception:</p>
  
  <pre><code>@Configuration
  public class AppConfig extends WebMvcConfigurerAdapter {
     @Bean
     public LocaleChangeInterceptor localeChangeInterceptor() {
         LocaleChangeInterceptor lci = new LocaleChangeInterceptor();
         lci.setParamName("lang");
         return lci;
     }
  
     @Override
     public void addInterceptors(InterceptorRegistry registry) {
         registry.addInterceptor(localeChangeInterceptor());
     }
  }
  </code></pre>
  
  <p>Results in:</p>
  
  <p><code>java.lang.UnsupportedOperationException: Cannot change HTTP accept header - use a different locale resolution strategy</code></p>