Close

Spring MVC - LocaleChangeInterceptor Examples

Spring MVC 

LocaleChangeInterceptor allows for changing the current locale when receives an http request containing the specified param name.

    @Bean
public WebMvcConfigurer configurer () {
return new WebMvcConfigurerAdapter() {
@Override
public void addInterceptors (InterceptorRegistry registry) {
LocaleChangeInterceptor l = new LocaleChangeInterceptor();
l.setParamName("localeCode");
registry.addInterceptor(l);
}
};
}
Original Post




See Also