org.displaytag.filter
Class DisplayTagSpringInterceptor
java.lang.Object
org.displaytag.filter.DisplayTagSpringInterceptor
- All Implemented Interfaces:
- org.springframework.web.servlet.HandlerInterceptor
- public class DisplayTagSpringInterceptor
- extends java.lang.Object
- implements org.springframework.web.servlet.HandlerInterceptor
Allow the author of an included JSP page to reset the content type to something else (like a binary stream), and then
write the new info back as the exclusive response, clearing the buffers of all previously added content.
This interceptor allows TableTag users to perform exports from pages that are run as includes, such as from Struts or
a jsp:include. If that is your intention, just add this interceptor to your spring dispatcher context xml and map it
to the appropriate requests, using something like:
<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="interceptors">
<list>
<bean class="org.displaytag.filter.DisplayTagSpringInterceptor"/>
</list>
</property
</bean>
By default the interceptor buffers all the export content before writing it out. You can set an optional parameter
buffer to false to make the interceptor write directly to the output stream. This could
be faster and uses less memory, but the content length will not be set.
<bean class="org.displaytag.filter.DisplayTagSpringInterceptor">
<property name="buffer"><value>false</value></property>
</bean>
- Version:
- $Revision: 1.8 $ ($Author: fgiust $)
- Author:
- Keith Garry Boyce, rapruitt, Fabrizio Giustina
|
Method Summary |
void |
afterCompletion(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.Object obj,
java.lang.Exception exception)
|
void |
postHandle(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.Object obj,
org.springframework.web.servlet.ModelAndView modelAndView)
|
boolean |
preHandle(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.Object handler)
|
void |
setBuffer(boolean bufferingEnabled)
Sets the buffer state. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DisplayTagSpringInterceptor
public DisplayTagSpringInterceptor()
setBuffer
public void setBuffer(boolean bufferingEnabled)
- Sets the buffer state.
- Parameters:
bufferingEnabled - it true buffering will be used
preHandle
public boolean preHandle(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.Object handler)
throws java.lang.Exception
- Specified by:
preHandle in interface org.springframework.web.servlet.HandlerInterceptor
- Throws:
java.lang.Exception- See Also:
HandlerInterceptor.preHandle(HttpServletRequest,HttpServletResponse, Object)
postHandle
public void postHandle(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.Object obj,
org.springframework.web.servlet.ModelAndView modelAndView)
throws java.lang.Exception
- Specified by:
postHandle in interface org.springframework.web.servlet.HandlerInterceptor
- Throws:
java.lang.Exception- See Also:
HandlerInterceptor.postHandle(HttpServletRequest,HttpServletResponse, Object, ModelAndView)
afterCompletion
public void afterCompletion(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.Object obj,
java.lang.Exception exception)
throws java.lang.Exception
- Specified by:
afterCompletion in interface org.springframework.web.servlet.HandlerInterceptor
- Throws:
java.lang.Exception- See Also:
HandlerInterceptor.afterCompletion(HttpServletRequest,HttpServletResponse, Object, Exception)
Copyright © 2002-2005 the Displaytag team. All Rights Reserved.