Skip to content

WebMvcAutoConfigurationAdapter needs an addInterceptors method to allow LocaleChangeInterceptor to be set #583

@csavory

Description

@csavory

I would like to add LocaleChangeInterceptor to a spring boot application. LocaleResolver resolver is easy because it is a bean, but LocaleChangeInterceptor has to be added to a registry.

I see this method on WebMvcAutoConfigurationAdapter:

public void addFormatters(FormatterRegistry registry) {

Could we add this too?

@Override
      public void addInterceptors(InterceptorRegistry registry) {

            for (HandlerInterceptor<?, ?> interceptor : getBeansOfType(HandlerInterceptor.class)) {
                registry.addInterceptor(interceptor);
            }
      }

so that i don't have to write my own @EnableWebMvc class and lose the default Spring Boot stuff.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions