public class ContentTypeInterceptor extends HandlerInterceptorAdapter implements BeanFactoryAware
| Constructor and Description |
|---|
ContentTypeInterceptor() |
| Modifier and Type | Method and Description |
|---|---|
void |
postHandle(HttpServletRequest request,
HttpServletResponse response,
Object handler,
ModelAndView modelAndView)
Compare the extension of the request path (if there is one) with the set provided, and if it matches then add the
same extension to the view name, if it is not already present.
|
boolean |
preHandle(HttpServletRequest request,
HttpServletResponse response,
Object handler) |
void |
setBeanFactory(BeanFactory beanFactory) |
void |
setExtensions(Collection<String> extensions)
A collection of extensions to append to view names.
|
afterCompletion, afterConcurrentHandlingStartedpublic void setBeanFactory(BeanFactory beanFactory) throws BeansException
setBeanFactory in interface BeanFactoryAwareBeansExceptionpublic void setExtensions(Collection<String> extensions)
extensions - the extensions (e.g. [rss, xml, atom])public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception
preHandle in interface HandlerInterceptorpreHandle in class HandlerInterceptorAdapterExceptionpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception
postHandle in interface HandlerInterceptorpostHandle in class HandlerInterceptorAdapterExceptionHandlerInterceptorAdapter.postHandle(HttpServletRequest, HttpServletResponse, Object, ModelAndView)Copyright © 2015. All rights reserved.