Add missing line to MVC config interceptors snippet

To ensure consistency with Kotlin and XML snippets.
This commit is contained in:
Sébastien Deleuze
2026-01-06 11:04:05 +01:00
parent e7f019bd3f
commit d752e80356
@@ -19,6 +19,7 @@ package org.springframework.docs.web.webmvc.mvcconfig.mvcconfiginterceptors;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.handler.UserRoleAuthorizationInterceptor;
import org.springframework.web.servlet.i18n.LocaleChangeInterceptor;
// tag::snippet[]
@@ -28,6 +29,7 @@ public class WebConfiguration implements WebMvcConfigurer {
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(new LocaleChangeInterceptor());
registry.addInterceptor(new UserRoleAuthorizationInterceptor()).addPathPatterns("/**").excludePathPatterns("/admin/**");
}
}
// end::snippet[]