Skip to content

Commit cb8ad46

Browse files
rinoriumrstoyanchev
authored andcommitted
Overloaded methods in InterceptorRegistration
Issue: SPR-16324
1 parent 45828cb commit cb8ad46

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/InterceptorRegistration.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@ public InterceptorRegistration addPathPatterns(String... patterns) {
6464
return this;
6565
}
6666

67+
/**
68+
* Add URL patterns as list to which the registered interceptor should apply to.
69+
*/
70+
public InterceptorRegistration addPathPatterns(List<String> patterns) {
71+
this.includePatterns.addAll(patterns);
72+
return this;
73+
}
74+
6775
/**
6876
* Add URL patterns to which the registered interceptor should not apply to.
6977
*/
@@ -72,6 +80,14 @@ public InterceptorRegistration excludePathPatterns(String... patterns) {
7280
return this;
7381
}
7482

83+
/**
84+
* Add URL patterns as list to which the registered interceptor should not apply to.
85+
*/
86+
public InterceptorRegistration excludePathPatterns(List<String> patterns) {
87+
this.excludePatterns.addAll(patterns);
88+
return this;
89+
}
90+
7591
/**
7692
* A PathMatcher implementation to use with this interceptor. This is an optional,
7793
* advanced property required only if using custom PathMatcher implementations

0 commit comments

Comments
 (0)