Add exclude patterns for mapped interceptors
Add the ability provide exclude patterns for mapped interceptors in the MVC namespace and in the MVC Java config. Issue: SPR-6570
This commit is contained in:
1
src/dist/changelog.txt
vendored
1
src/dist/changelog.txt
vendored
@@ -25,6 +25,7 @@ Changes in version 3.2 M2 (2012-08-xx)
|
||||
* parameterize DeferredResult type
|
||||
* use reflection to instantiate StandardServletAsyncWebRequest
|
||||
* fix issue with forward before async request processing
|
||||
* add exclude patterns for mapped interceptors in MVC namespace and MVC Java config
|
||||
|
||||
|
||||
Changes in version 3.2 M1 (2012-05-28)
|
||||
|
||||
@@ -4453,7 +4453,8 @@ public class WebConfig extends WebMvcConfigurerAdapter {
|
||||
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry) {
|
||||
registry.addInterceptor(new LocalInterceptor());
|
||||
registry.addInterceptor(new LocaleInterceptor());
|
||||
registry.addInterceptor(new ThemeInterceptor()).addPathPatterns("/**").excludePathPatterns("/admin/**");
|
||||
registry.addInterceptor(new SecurityInterceptor()).addPathPatterns("/secure/*");
|
||||
}
|
||||
|
||||
@@ -4463,6 +4464,11 @@ public class WebConfig extends WebMvcConfigurerAdapter {
|
||||
|
||||
<programlisting language="xml"><mvc:interceptors>
|
||||
<bean class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor" />
|
||||
<mvc:interceptor>
|
||||
<mapping path="/**"/>
|
||||
<exclude-mapping path="/admin/**"/>
|
||||
<bean class="org.springframework.web.servlet.theme.ThemeChangeInterceptor" />
|
||||
</mvc:interceptor>
|
||||
<mvc:interceptor>
|
||||
<mapping path="/secure/*"/>
|
||||
<bean class="org.example.SecurityInterceptor" />
|
||||
|
||||
Reference in New Issue
Block a user