tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tali Ambar <Ta...@tecnomatix.com>
Subject FW: [ERROR] OutputStream is already being used for this request
Date Wed, 02 May 2001 06:12:16 GMT

> Hi
> 
> 1. I'm trying to pass a stream to an html in order to see GIF files in a
> stream form on the browser.
> 
> 2. I wrote (in a servlet) the following lines
> 
> IStream  stream = ...; // stream of a  file in a GIF format
> 
> response.setContentType ("image/GIF");
> ServletOutputStream outStream = response.getOutputStream();
> 
> int p1 = 10000;
> int[] p2 = new int[1];
> byte bytes[] = new byte[1];
> stream.RemoteRead(bytes,p1,p2);
> outStream.write(bytes);
> 
> 3. This servlet is called by a jsp which is called from an Html file (by
> the tag:  <img src="myJsp.jsp">)
> 
> 4. When running only the servlet I can see the GIF file.
> 
> 5. When I run the jsp I get the following error:
> "Error 500: 
> OutputStream is already being used for this request
> at org.apache.tomcat.core.ResponseImpl.getWriter(ResponseImpl.java:210)" 
> 
> 6. running the html file fails
> 
> 7. I can not use PrintWriter servlet because I need to pass binary data
> and not test.
> 
> Thanks
> Tali
> 
> Email: talia@tecnomatix.com
> 

Mime
View raw message