You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Sh...@ngc.com on 2004/04/08 16:50:37 UTC

Slightly OT: Preventing of buffer flush with tiles:insert

I'm trying to use a custom tag to gzip (compress) pages (filter won't work because I'm in a servlet 2.3 environment).  On straightforward JSP's, it works fine.  But in "layout" JSP's which employ the <tiles:insert> 
tag, I get IOExceptions and the container complains "Illegal to flush within a custom tag," pointing to javax.servlet.jsp.tagext.BodyContent.flush(BodyContent.java:115).

Looking at the J2EE API docs, it looks like the pageContext.include() method (which the tiles:insert tag uses) flushes the content before including the specified tile/resource.

I've already tried:

- Returning EVAL_BODY_BUFFERED in the tag's doStartTag() method, in the hopes of flushing the "temporary" buffer instead.
- Setting the tiles:insert "flush" attribute to "false", but it looks like from the source code that only performs an additional flush before handing control over to the pageContent.include(), which flushes on its own.
- Using the page directive to set the buffer size extremely high (4096kb) and autoFlush to "false".

Any ideas?

Thanks,

Shahak Nagiel
Software Engineer
Northrop Grumman Mission Systems

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Slightly OT: Preventing of buffer flush with tiles:insert

Posted by Richard Yee <ry...@yahoo.com>.
Shahak,
Why won't a filter work in you Servlet 2.3
environment? Filters exist in the Servlet 2.3 spec.
They don't exist in the Servlet 2.2 spec.

Regards,

Richard

--- Shahak.Nagiel@ngc.com wrote:
> I'm trying to use a custom tag to gzip (compress)
> pages (filter won't work because I'm in a servlet
> 2.3 environment).  On straightforward JSP's, it
> works fine.  But in "layout" JSP's which employ the
> <tiles:insert> 
> tag, I get IOExceptions and the container complains
> "Illegal to flush within a custom tag," pointing to
>
javax.servlet.jsp.tagext.BodyContent.flush(BodyContent.java:115).
> 
> Looking at the J2EE API docs, it looks like the
> pageContext.include() method (which the tiles:insert
> tag uses) flushes the content before including the
> specified tile/resource.
> 
> I've already tried:
> 
> - Returning EVAL_BODY_BUFFERED in the tag's
> doStartTag() method, in the hopes of flushing the
> "temporary" buffer instead.
> - Setting the tiles:insert "flush" attribute to
> "false", but it looks like from the source code that
> only performs an additional flush before handing
> control over to the pageContent.include(), which
> flushes on its own.
> - Using the page directive to set the buffer size
> extremely high (4096kb) and autoFlush to "false".
> 
> Any ideas?
> 
> Thanks,
> 
> Shahak Nagiel
> Software Engineer
> Northrop Grumman Mission Systems
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 


__________________________________
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway 
http://promotions.yahoo.com/design_giveaway/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org