Class ConversionServiceExposingInterceptor
- java.lang.Object
- org.springframework.web.servlet.handler.HandlerInterceptorAdapter
- org.springframework.web.servlet.handler.ConversionServiceExposingInterceptor
- All Implemented Interfaces:
AsyncHandlerInterceptor,HandlerInterceptor
public class ConversionServiceExposingInterceptor extends HandlerInterceptorAdapter
Interceptor that places the configuredConversionServicein request scope so it's available during request processing. The request attribute name is "org.springframework.core.convert.ConversionService", the value ofConversionService.class.getName().Mainly for use within JSP tags such as the spring:eval tag.
- Since:
- 3.0.1
- Author:
- Keith Donald
Constructor Summary
Constructors Constructor Description ConversionServiceExposingInterceptor(ConversionService conversionService)Creates a newConversionServiceExposingInterceptor.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanpreHandle(HttpServletRequest request, HttpServletResponse response, Object handler)This implementation always returnstrue.Methods inherited from class org.springframework.web.servlet.handler.HandlerInterceptorAdapter
afterCompletion, afterConcurrentHandlingStarted, postHandle
Constructor Detail
ConversionServiceExposingInterceptor
public ConversionServiceExposingInterceptor(ConversionService conversionService)
Creates a newConversionServiceExposingInterceptor.- Parameters:
conversionService- the conversion service to export to request scope when this interceptor is invoked
Method Detail
preHandle
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws ServletException, IOException
Description copied from class:HandlerInterceptorAdapterThis implementation always returnstrue.- Specified by:
preHandlein interfaceHandlerInterceptor- Overrides:
preHandlein classHandlerInterceptorAdapter- Parameters:
request- current HTTP requestresponse- current HTTP responsehandler- chosen handler to execute, for type and/or instance evaluation- Returns:
trueif 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:
ServletExceptionIOException