You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Graf László <gr...@axis.hu> on 2005/11/03 09:14:33 UTC

"Illegal to flush within a custom tag"

Hi
I have some custom tags which can have in body
other custom tag(s). Some of them list the content
of a ResultSet in HTML page. I used flush to force
the output of HTML.

This solution works fine using IAS9i but ported to
JBoss 4.0.3 (what includes Tomcat 5.5.9) it throws

"java.io.IOException: Illegal to flush within a custom tag
    at javax.servlet.jsp.tagext.BodyContent.flush(BodyContent.java:79)".

If I do comment those lines containing 'flush', the
output does not appear. How can I fix this problem?

-- 
László Graf


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: "Illegal to flush within a custom tag"

Posted by Tim Funk <fu...@joedog.org>.
It looks like your custom tag is creating its own body content. The body 
content is handed back to the tag so furthur transformations may be done on 
it. So the whole tag needs evaluated and buffered before it may be flushed.

Your tag is returning BodyTag.EVAL_BODY_BUFFERED during doStartTag(). If it 
returns Tag.EVAL_BODY_INCLUDE, then the contents in the tag will be writing 
directly to the current output buffer.

-Tim

Graf László wrote:

> Hi
> I have some custom tags which can have in body
> other custom tag(s). Some of them list the content
> of a ResultSet in HTML page. I used flush to force
> the output of HTML.
> 
> This solution works fine using IAS9i but ported to
> JBoss 4.0.3 (what includes Tomcat 5.5.9) it throws
> 
> "java.io.IOException: Illegal to flush within a custom tag
>    at javax.servlet.jsp.tagext.BodyContent.flush(BodyContent.java:79)".
> 
> If I do comment those lines containing 'flush', the
> output does not appear. How can I fix this problem?
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org