Class ResourceUrlProviderExposingInterceptor
- java.lang.Object
- org.springframework.web.servlet.handler.HandlerInterceptorAdapter
- org.springframework.web.servlet.resource.ResourceUrlProviderExposingInterceptor
- All Implemented Interfaces:
AsyncHandlerInterceptor
,HandlerInterceptor
public class ResourceUrlProviderExposingInterceptor extends HandlerInterceptorAdapter
An interceptor that exposes theResourceUrlProvider
instance it is configured with as a request attribute.- Since:
- 4.1
- Author:
- Rossen Stoyanchev
Field Summary
Fields Modifier and Type Field Description static String
RESOURCE_URL_PROVIDER_ATTR
Name of the request attribute that holds theResourceUrlProvider
.
Constructor Summary
Constructors Constructor Description ResourceUrlProviderExposingInterceptor(ResourceUrlProvider resourceUrlProvider)
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
This implementation always returnstrue
.Methods inherited from class org.springframework.web.servlet.handler.HandlerInterceptorAdapter
afterCompletion, afterConcurrentHandlingStarted, postHandle
Field Detail
RESOURCE_URL_PROVIDER_ATTR
public static final String RESOURCE_URL_PROVIDER_ATTR
Name of the request attribute that holds theResourceUrlProvider
.
Constructor Detail
ResourceUrlProviderExposingInterceptor
public ResourceUrlProviderExposingInterceptor(ResourceUrlProvider resourceUrlProvider)
Method Detail
preHandle
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception
Description copied from class:HandlerInterceptorAdapter
This implementation always returnstrue
.- Specified by:
preHandle
in interfaceHandlerInterceptor
- Overrides:
preHandle
in classHandlerInterceptorAdapter
- Parameters:
request
- current HTTP requestresponse
- current HTTP responsehandler
- chosen handler to execute, for type and/or instance evaluation- Returns:
true
if the execution chain should proceed with the next interceptor or the handler itself. Else, DispatcherServlet assumes that this interceptor has already dealt with the response itself.- Throws:
Exception
- in case of errors