Class InterceptorRegistration
java.lang.Object
org.springframework.web.servlet.config.annotation.InterceptorRegistration
Assists with the creation of a 
MappedInterceptor.- Since:
- 3.1
- Author:
- Rossen Stoyanchev, Keith Donald
- 
Constructor SummaryConstructorsConstructorDescriptionInterceptorRegistration(HandlerInterceptor interceptor) Create anInterceptorRegistrationinstance.
- 
Method SummaryModifier and TypeMethodDescriptionaddPathPatterns(String... patterns) Add patterns for URLs the interceptor should be included in.addPathPatterns(List<String> patterns) List-based variant ofaddPathPatterns(String...).excludePathPatterns(String... patterns) Add patterns for URLs the interceptor should be excluded from.excludePathPatterns(List<String> patterns) List-based variant ofexcludePathPatterns(String...).protected ObjectBuild the underlying interceptor.protected intgetOrder()Return the order position to be used.order(int order) Specify an order position to be used.pathMatcher(PathMatcher pathMatcher) Deprecated, for removal: This API element is subject to removal in a future version.
- 
Constructor Details- 
InterceptorRegistrationCreate anInterceptorRegistrationinstance.
 
- 
- 
Method Details- 
addPathPatternsAdd patterns for URLs the interceptor should be included in.For pattern syntax see PathPatternwhen parsed patterns areenabledorAntPathMatcherotherwise. The syntax is largely the same withPathPatternmore tailored for web usage and more efficient.
- 
addPathPatternsList-based variant ofaddPathPatterns(String...).- Since:
- 5.0.3
 
- 
excludePathPatternsAdd patterns for URLs the interceptor should be excluded from.For pattern syntax see PathPatternwhen parsed patterns areenabledorAntPathMatcherotherwise. The syntax is largely the same withPathPatternmore tailored for web usage and more efficient.
- 
excludePathPatternsList-based variant ofexcludePathPatterns(String...).- Since:
- 5.0.3
 
- 
pathMatcher@Deprecated(since="7.0", forRemoval=true) public InterceptorRegistration pathMatcher(PathMatcher pathMatcher) Deprecated, for removal: This API element is subject to removal in a future version.use ofPathMatcherandUrlPathHelperis deprecated for use at runtime in web modules in favor of parsed patterns withPathPatternParser.Configure the PathMatcher to use to match URL paths with against include and exclude patterns.This is an advanced property that should be used only when a customized AntPathMatcheror a custom PathMatcher is required.By default this is AntPathMatcher.Note: Setting PathMatcherenforces use of String pattern matching even when aparsedRequestPathis available.
- 
orderSpecify an order position to be used. Default is 0.- Since:
- 4.3.23
 
- 
getOrderprotected int getOrder()Return the order position to be used.
- 
getInterceptorBuild the underlying interceptor. If URL patterns are provided, the returned type isMappedInterceptor; otherwiseHandlerInterceptor.
 
- 
PathMatcherandUrlPathHelperis deprecated for use at runtime in web modules in favor of parsed patterns withPathPatternParser.