public class ContentTypeInterceptor
extends org.springframework.web.servlet.handler.HandlerInterceptorAdapter
implements org.springframework.beans.factory.BeanFactoryAware
Constructor and Description |
---|
ContentTypeInterceptor() |
Modifier and Type | Method and Description |
---|---|
void |
postHandle(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Object handler,
org.springframework.web.servlet.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(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Object handler) |
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) |
void |
setExtensions(Collection<String> extensions)
A collection of extensions to append to view names.
|
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException
setBeanFactory
in interface org.springframework.beans.factory.BeanFactoryAware
org.springframework.beans.BeansException
public void setExtensions(Collection<String> extensions)
extensions
- the extensions (e.g. [rss, xml, atom])public boolean preHandle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object handler) throws Exception
preHandle
in interface org.springframework.web.servlet.HandlerInterceptor
preHandle
in class org.springframework.web.servlet.handler.HandlerInterceptorAdapter
Exception
public void postHandle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object handler, org.springframework.web.servlet.ModelAndView modelAndView) throws Exception
postHandle
in interface org.springframework.web.servlet.HandlerInterceptor
postHandle
in class org.springframework.web.servlet.handler.HandlerInterceptorAdapter
Exception
HandlerInterceptorAdapter.postHandle(HttpServletRequest, HttpServletResponse, Object, ModelAndView)
Copyright © 2015. All rights reserved.