接口的使用
org.springframework.web.servlet.HandlerInterceptor
使用HandlerInterceptor的程序包 程序包 说明 org.springframework.test.web.servlet Contains server-side support for testing Spring MVC applications.org.springframework.test.web.servlet.result Contains built-inResultMatcher
andResultHandler
implementations.org.springframework.test.web.servlet.setup Contains built-inMockMvcBuilder
implementations.org.springframework.web.servlet Provides servlets that integrate with the application context infrastructure, and the core interfaces and classes for the Spring web MVC framework.org.springframework.web.servlet.config.annotation Annotation-based setup for Spring MVC.org.springframework.web.servlet.handler Provides standard HandlerMapping implementations, including abstract base classes for custom implementations.org.springframework.web.servlet.i18n Locale support classes for Spring's web MVC framework.org.springframework.web.servlet.mvc Standard controller implementations for the Servlet MVC framework that comes with Spring.org.springframework.web.servlet.resource Support classes for serving static resources.org.springframework.web.servlet.theme Theme support classes for Spring's web MVC framework.org.springframework.test.web.servlet中HandlerInterceptor的使用
返回HandlerInterceptor的org.springframework.test.web.servlet中的方法 修饰符和类型 方法 说明 HandlerInterceptor[]
MvcResult. getInterceptors()
Return interceptors around the handler.org.springframework.test.web.servlet.result中HandlerInterceptor的使用
参数类型为HandlerInterceptor的org.springframework.test.web.servlet.result中的方法 修饰符和类型 方法 说明 protected void
PrintingResultHandler. printHandler(Object handler, HandlerInterceptor[] interceptors)
Print the handler.org.springframework.test.web.servlet.setup中HandlerInterceptor的使用
参数类型为HandlerInterceptor的org.springframework.test.web.servlet.setup中的方法 修饰符和类型 方法 说明 StandaloneMockMvcBuilder
StandaloneMockMvcBuilder. addInterceptors(HandlerInterceptor... interceptors)
Add interceptors mapped to all incoming requests.StandaloneMockMvcBuilder
StandaloneMockMvcBuilder. addMappedInterceptors(String[] pathPatterns, HandlerInterceptor... interceptors)
Add interceptors mapped to a set of path patterns.org.springframework.web.servlet中HandlerInterceptor的使用
org.springframework.web.servlet中HandlerInterceptor的子接口 修饰符和类型 接口 说明 interface
AsyncHandlerInterceptor
ExtendsHandlerInterceptor
with a callback method invoked after the start of asynchronous request handling.返回HandlerInterceptor的org.springframework.web.servlet中的方法 修饰符和类型 方法 说明 HandlerInterceptor[]
HandlerExecutionChain. getInterceptors()
Return the array of interceptors to apply (in the given order).参数类型为HandlerInterceptor的org.springframework.web.servlet中的方法 修饰符和类型 方法 说明 void
HandlerExecutionChain. addInterceptor(int index, HandlerInterceptor interceptor)
Add the given interceptor at the specified index of this chain.void
HandlerExecutionChain. addInterceptor(HandlerInterceptor interceptor)
Add the given interceptor to the end of this chain.void
HandlerExecutionChain. addInterceptors(HandlerInterceptor... interceptors)
Add the given interceptors to the end of this chain.参数类型为HandlerInterceptor的org.springframework.web.servlet中的构造器 构造器 说明 HandlerExecutionChain(Object handler, HandlerInterceptor... interceptors)
Create a new HandlerExecutionChain.org.springframework.web.servlet.config.annotation中HandlerInterceptor的使用
参数类型为HandlerInterceptor的org.springframework.web.servlet.config.annotation中的方法 修饰符和类型 方法 说明 InterceptorRegistration
InterceptorRegistry. addInterceptor(HandlerInterceptor interceptor)
Adds the providedHandlerInterceptor
.参数类型为HandlerInterceptor的org.springframework.web.servlet.config.annotation中的构造器 构造器 说明 InterceptorRegistration(HandlerInterceptor interceptor)
Create anInterceptorRegistration
instance.org.springframework.web.servlet.handler中HandlerInterceptor的使用
实现HandlerInterceptor的org.springframework.web.servlet.handler中的类 修饰符和类型 类 说明 class
ConversionServiceExposingInterceptor
Interceptor that places the configuredConversionService
in request scope so it's available during request processing.class
HandlerInterceptorAdapter
Abstract adapter class for theAsyncHandlerInterceptor
interface, for simplified implementation of pre-only/post-only interceptors.class
MappedInterceptor
Contains and delegates calls to aHandlerInterceptor
along with include (and optionally exclude) path patterns to which the interceptor should apply.class
UserRoleAuthorizationInterceptor
Interceptor that checks the authorization of the current user via the user's roles, as evaluated by HttpServletRequest's isUserInRole method.class
WebRequestHandlerInterceptorAdapter
Adapter that implements the Servlet HandlerInterceptor interface and wraps an underlying WebRequestInterceptor.返回HandlerInterceptor的org.springframework.web.servlet.handler中的方法 修饰符和类型 方法 说明 protected HandlerInterceptor
AbstractHandlerMapping. adaptInterceptor(Object interceptor)
Adapt the given interceptor object toHandlerInterceptor
.protected HandlerInterceptor[]
AbstractHandlerMapping. getAdaptedInterceptors()
Return the adapted interceptors asHandlerInterceptor
array.HandlerInterceptor
MappedInterceptor. getInterceptor()
The actualHandlerInterceptor
reference.类型变量类型为HandlerInterceptor的org.springframework.web.servlet.handler中的方法参数 修饰符和类型 方法 说明 protected void
AbstractHandlerMapping. detectMappedInterceptors(List<HandlerInterceptor> mappedInterceptors)
Detect beans of typeMappedInterceptor
and add them to the list of mapped interceptors.参数类型为HandlerInterceptor的org.springframework.web.servlet.handler中的构造器 构造器 说明 MappedInterceptor(String[] includePatterns, String[] excludePatterns, HandlerInterceptor interceptor)
Create a new MappedInterceptor instance.MappedInterceptor(String[] includePatterns, HandlerInterceptor interceptor)
Create a new MappedInterceptor instance.org.springframework.web.servlet.i18n中HandlerInterceptor的使用
实现HandlerInterceptor的org.springframework.web.servlet.i18n中的类 修饰符和类型 类 说明 class
LocaleChangeInterceptor
Interceptor that allows for changing the current locale on every request, via a configurable request parameter (default parameter name: "locale").org.springframework.web.servlet.mvc中HandlerInterceptor的使用
实现HandlerInterceptor的org.springframework.web.servlet.mvc中的类 修饰符和类型 类 说明 class
WebContentInterceptor
Handler interceptor that checks the request and prepares the response.org.springframework.web.servlet.resource中HandlerInterceptor的使用
实现HandlerInterceptor的org.springframework.web.servlet.resource中的类 修饰符和类型 类 说明 class
ResourceUrlProviderExposingInterceptor
An interceptor that exposes theResourceUrlProvider
instance it is configured with as a request attribute.org.springframework.web.servlet.theme中HandlerInterceptor的使用
实现HandlerInterceptor的org.springframework.web.servlet.theme中的类 修饰符和类型 类 说明 class
ThemeChangeInterceptor
Interceptor that allows for changing the current theme on every request, via a configurable request parameter (default parameter name: "theme").