tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shanti Suresh <>
Subject Re: Registering Plugins, e.g. javax.imageio...
Date Fri, 13 Sep 2013 13:29:03 GMT
On Thu, Sep 12, 2013 at 11:06 AM, Christopher Schultz <> wrote:

> Hash: SHA256
> Shanti,
> I think you are confused about a few things. Flushing the stream does
> not close it, but the finalizer I believe also closes the stream as
> well. Tomcat may not allow the stream to actually be closed (because
> Tomcat wants the stream to say open... at least the "stream" object
> that it presents to servlets), so the close() does nothing. The
> flush(), however, still occurs.
> Flushing the OutputStream of a response "commits" the response --
> meaning that the bytes are actually sent to the client. If that
> happens (remember: ImageIO is interfering with a "later" and unrelated
> request to the image-related one) than the later request -- still
> in-process -- might not have expected that response-commit and things
> like request.getSession() can fail because those calls must be made
> before the response has been sent to the client (because creating the
> JSESSIONID cookie requires setting a response header).
> Hope that helps,
> - -chris

Thanks for the explanation, Chris.  That's now clear to me.

Appreciate it!


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message