Home » displaytag-1.1.1-src » org » displaytag » filter » [javadoc | source]
org.displaytag.filter
public class: DisplayTagSpringInterceptor [javadoc | source]
java.lang.Object
   org.displaytag.filter.DisplayTagSpringInterceptor

All Implemented Interfaces:
    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>
Field Summary
static  Log log    Logger. 
Method from org.displaytag.filter.DisplayTagSpringInterceptor Summary:
afterCompletion,   postHandle,   preHandle,   setBuffer
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.displaytag.filter.DisplayTagSpringInterceptor Detail:
 public  void afterCompletion(HttpServletRequest request,
    HttpServletResponse response,
    Object obj,
    Exception exception) throws Exception 
 public  void postHandle(HttpServletRequest request,
    HttpServletResponse response,
    Object obj,
    ModelAndView modelAndView) throws Exception 
 public boolean preHandle(HttpServletRequest request,
    HttpServletResponse response,
    Object handler) throws Exception 
 public  void setBuffer(boolean bufferingEnabled) 
    Sets the buffer state.