From cb8ad465642d7cfa04403fe076688b5fdcdcb82f Mon Sep 17 00:00:00 2001 From: Aleksey Voronenkov Date: Sun, 24 Dec 2017 03:56:18 +0300 Subject: [PATCH] Overloaded methods in InterceptorRegistration Issue: SPR-16324 --- .../annotation/InterceptorRegistration.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 23109bdf03..b4b033059f 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,14 @@ public class InterceptorRegistration { return this; } + /** + * Add URL patterns as list to which the registered interceptor should apply to. + */ + 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 +80,14 @@ public class InterceptorRegistration { return this; } + /** + * Add URL patterns as list to which the registered interceptor should not apply to. + */ + 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