org.springmodules.validation.bean.context.web
Class ValidationContextHandlerInterceptor
java.lang.Object
org.springframework.web.servlet.handler.HandlerInterceptorAdapter
org.springmodules.validation.bean.context.web.ValidationContextHandlerInterceptor
- All Implemented Interfaces:
- HandlerInterceptor
public class ValidationContextHandlerInterceptor
- extends HandlerInterceptorAdapter
An interceptor that sets the validation context based on configured mappings of url patterns to validation context
tokens. This interceptor is the Spring MVC counterpart of the ValidationContextFilter
.
- Author:
- Uri Boness
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ValidationContextHandlerInterceptor
public ValidationContextHandlerInterceptor()
preHandle
public boolean preHandle(HttpServletRequest request,
HttpServletResponse response,
Object handler)
throws Exception
- Creates and sets the validation context based on the request URI. The validation context tokens are determined
by the configured
ValidationContextUrlMapping
's.
- Specified by:
preHandle
in interface HandlerInterceptor
- Overrides:
preHandle
in class HandlerInterceptorAdapter
- Throws:
Exception
- See Also:
HandlerInterceptorAdapter.preHandle(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, Object)
,
setValidationContextUrlMappings(ValidationContextUrlMapping[])
postHandle
public void postHandle(HttpServletRequest request,
HttpServletResponse response,
Object handler,
ModelAndView modelAndView)
throws Exception
- Clears
- Specified by:
postHandle
in interface HandlerInterceptor
- Overrides:
postHandle
in class HandlerInterceptorAdapter
- Parameters:
request
- response
- handler
- modelAndView
-
- Throws:
Exception
getValidationContextUrlMappings
public ValidationContextUrlMapping[] getValidationContextUrlMappings()
setValidationContextUrlMappings
public void setValidationContextUrlMappings(ValidationContextUrlMapping[] validationContextUrlMappings)
getPathMatcher
public PathMatcher getPathMatcher()
setPathMatcher
public void setPathMatcher(PathMatcher pathMatcher)
Copyright © 2009. All Rights Reserved.