> 
> 
> This shouldn't be hard to add this filter to the code base and then  
> suggest adding the settings to web.xml when using Tiles.
> 

The filter is also necessary anytime your JSP page is included in
another page; it looks like some/many (I'm using Jetty) containers will
not let an included page reset the content type, and you won't be able
to clear the already write()'d content.

Here are the files w/ displaytag packages.  TableTag#writeExport should
add 

 
pageContext.getRequest().setAttribute(org.displaytag.util.ResponseOverri
deFilter.CONTENT_OVERRIDE_TYPE, pMimeType);
 
pageContext.getRequest().setAttribute(org.displaytag.util.ResponseOverri
deFilter.CONTENT_OVERRIDE_BODY, pExportString);
 
at line 867.

> Thanks!
> 
> Matt
> 
> On Monday, September 29, 2003, at 10:17 AM, Andy Pruitt wrote:
> 
> > Ok, here is a fix for the dreaded "no export in tiles or included 
> > jsps" problem.
> >
> > This fix allows exports to work seamlessly, without 
> requiring the JSP 
> > author to duplicate the table tag, although it does require 
> a filter 
> > to be added to web.xml.
> >
> > The trick is that I changed the writeExport() method of TableTag to 
> > write the output into the Request object instead of to the page.  A 
> > filter then checks for overriding content, and if content is present
> > the
> > filter will dump the page response and substitute in the overriding
> > content.
> >
> > It's a hack, but it works.
> >
> >
> >
> >
> > Change display.tld:
> >   <tag>
> >     <name>table</name>
> >     <tagclass>com.backstopsolutions.web.TableTag</tagclass>
> > <!--    <tagclass>org.displaytag.tags.TableTag</tagclass>-->
> >
> >
> > To your web.xml:
> >    <filter>
> >       <filter-name>ResponseOverrideFilter</filter-name>
> >
> > <filter-class>com.backstopsolutions.web.ResponseOverrideFilter</
> > filter-c
> > lass>
> >    </filter>
> >    <filter-mapping>
> >       <filter-name>ResponseOverrideFilter</filter-name>
> >       <url-pattern>*.do</url-pattern>
> >    </filter-mapping>
> >    <filter-mapping>
> >       <filter-name>ResponseOverrideFilter</filter-name>
> >       <url-pattern>*.jsp</url-pattern>
> >    </filter-mapping>
> >
> >
> >
> >
> > ---andy pruitt 
> > 
> <TableTag.java><BufferedResponseWrapper.java><ResponseOverrideFilter.j
> > a
> > va>
> 
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf 
> _______________________________________________
> displaytag-devel mailing list [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/displaytag-devel
> 
> 

Attachment: ResponseOverrideFilter.java
Description: ResponseOverrideFilter.java

Attachment: BufferedResponseWrapper.java
Description: BufferedResponseWrapper.java

Reply via email to