public class ConversionServiceExposingInterceptor extends Object implements HandlerInterceptor
ConversionService
in request scope
so it's available during request processing. The request attribute name is
"org.springframework.core.convert.ConversionService", the value of
ConversionService.class.getName()
.
Mainly for use within JSP tags such as the spring:eval tag.
Constructor and Description |
---|
ConversionServiceExposingInterceptor(ConversionService conversionService)
Creates a new
ConversionServiceExposingInterceptor . |
Modifier and Type | Method and Description |
---|---|
boolean |
preHandle(HttpServletRequest request,
HttpServletResponse response,
Object handler)
Interception point before the execution of a handler.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
afterCompletion, postHandle
public ConversionServiceExposingInterceptor(ConversionService conversionService)
ConversionServiceExposingInterceptor
.conversionService
- the conversion service to export to request scope when this interceptor is invokedpublic boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws ServletException, IOException
HandlerInterceptor
DispatcherServlet processes a handler in an execution chain, consisting of any number of interceptors, with the handler itself at the end. With this method, each interceptor can decide to abort the execution chain, typically sending an HTTP error or writing a custom response.
Note: special considerations apply for asynchronous
request processing. For more details see
AsyncHandlerInterceptor
.
The default implementation returns true
.
preHandle
in interface HandlerInterceptor
request
- current HTTP requestresponse
- current HTTP responsehandler
- chosen handler to execute, for type and/or instance evaluationtrue
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.ServletException
IOException