Bug 31009 - io:http tag caches JSPWriter
Summary: io:http tag caches JSPWriter
Alias: None
Product: Taglibs
Classification: Unclassified
Component: IO Taglib (show other bugs)
Version: nightly
Hardware: Sun Solaris
: P3 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2004-09-02 03:18 UTC by Andrew McCulloch
Modified: 2009-11-29 19:39 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Andrew McCulloch 2004-09-02 03:18:02 UTC
When using the io:http tag with Tomcat 5.x a bug in the tag is exposed that 
was not exposed under tomcat 4.x.  The file URLTag.java (parent of 
HttpTag.java) caches the JspWriter between calls to endTag() and startTag().  
In Tomcat 5.x it appears that the Tag instances are being pooled and reused 
without a call to reset() before the reuse.  In this cas the Tag may be reused 
by a different page, or smae page in a different session.  When this happens 
the tag may write to a cached instance of the JspWriter instead of the current 
JspWriter causing blank output, or even output to the wrong user's browser.
Comment 1 Fredrik Harloff 2006-10-20 06:16:01 UTC
Just need to null reader and writer in doStartTag. I have been running this in
prod for 6 months.

    public int doStartTag() throws JspException {
        fullURL = null;
        connection = null;
>        reader = null;
>        writer = null;
        return EVAL_BODY_INCLUDE;

Would be nice if someone bothers to fix this issue :-)
Comment 2 Henri Yandell 2009-11-29 19:39:16 UTC
Resolving. Taglib has been retired.