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, afterConcurrentHandlingStarted
public void setBeanFactory(BeanFactory beanFactory) throws BeansException
setBeanFactory
in interface BeanFactoryAware
BeansException
public 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 HandlerInterceptor
preHandle
in class HandlerInterceptorAdapter
Exception
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception
postHandle
in interface HandlerInterceptor
postHandle
in class HandlerInterceptorAdapter
Exception
HandlerInterceptorAdapter.postHandle(HttpServletRequest, HttpServletResponse, Object, ModelAndView)
Copyright © 2015. All rights reserved.