You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Michael Wentzel <Mi...@aswethink.com> on 2001/04/06 14:52:24 UTC

RE: OutputStream Already in USE ..!!!!

I don't know why you get a OutputStream already in use, but the reason why
it works with IE and not with Netscape may be because you do not set
properly the Content-type of your image. Indeed, IE seems to be a little bit
cleverer than Netscape because it interprets the real content of a file
before displaying it instead of only looking at the Content-type header
property. So you have to be more explicit with Netscape.
 
BenoƮt 
 
 I am using Tomcat and trying to write a Gif file to client browser window
using JSP.
I use ACME - GifEncoder to convert the picture to GIF.
The Encoder needs OutputStream type object as one of the parameter in its
constructor.
I am using ServletOutputStream object for this, which i got through
response.getOutputStream().

But the tomcat gives Error as "OutputStream already been used."  

But the GIF image is Displayed properly in IE 5.0.

It gives ASCII charactes in Netscape.

Why is this so.
----------------------------------------------------------------------------
----------------------
The OutputStream already in use is because the automatically generated code
in a jsp class file
gets the output stream as a JSPWriter therefore when getOutputStream() is
called it thinks there
is already an 'external lock' of this resource object and doesn't think it
can use it.

BTW, please post to the list in plain text.  This has been stated over and
over and is also listed
on the website as one of the mailing list guidelines.  More people will be
willing to answer your
questions if you post in plain text.



---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com