diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/InterceptorRegistration.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/InterceptorRegistration.java index 23109bdf03a..bb95e542b76 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/InterceptorRegistration.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/InterceptorRegistration.java @@ -64,6 +64,15 @@ public class InterceptorRegistration { return this; } + /** + * List-based variant of {@link #addPathPatterns(String...)}. + * @since 5.0.3 + */ + public InterceptorRegistration addPathPatterns(List patterns) { + this.includePatterns.addAll(patterns); + return this; + } + /** * Add URL patterns to which the registered interceptor should not apply to. */ @@ -72,6 +81,15 @@ public class InterceptorRegistration { return this; } + /** + * List-based variant of {@link #excludePathPatterns(String...)}. + * @since 5.0.3 + */ + public InterceptorRegistration excludePathPatterns(List patterns) { + this.excludePatterns.addAll(patterns); + return this; + } + /** * A PathMatcher implementation to use with this interceptor. This is an optional, * advanced property required only if using custom PathMatcher implementations