You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Nitin Mulimani <ni...@ivis.com> on 2004/09/01 00:09:55 UTC

RE: Reading Servlet OutputStream

The issue being how do I write to PipedOutputStream().
These are the lines I'm thinking ..

PipedOutputSteam out = new PipedOutputStream();
out.write(ServletOutputStream.read());

But I do not know a way to read data from an output stream

--- Nitin
-----Original Message-----
From: Nandish Rudra [mailto:nrudra@calleci.com] 
Sent: Tuesday, August 31, 2004 9:40 AM
To: 'Tomcat Users List'
Subject: RE: Reading Servlet OutputStream

Here is something u guys can do.

PipedOutputStream and PipedInputStream to redirect the output stream and
read the data into a buffer and then do with it what u please.

regards
NR


-----Original Message-----
From: James Sherwood [mailto:jsherwood@romulin.com]
Sent: Tuesday, August 31, 2004 12:48 PM
To: Tomcat Users List
Subject: Re: Reading Servlet OutputStream


I am not using JSP, I am using Tapestry, any other ideas on how to
accomplish this?

James

----- Original Message ----- 
From: "John Villar" <jo...@florhard.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Tuesday, August 31, 2004 1:31 PM
Subject: Re: Reading Servlet OutputStream


> certainly.... my error.... the method is from the JSP API JspContext
> http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jspapi/index.html
> I ran into a problem that needed writing a zip file from the JSP page
>
> sorry for that one, however, with that method you could do what you're
> trying
>
> Nitin Mulimani escribió:
>
> >Hi John,
> >
> >I am checking the Servlet2.3 api, and do not find a pushBody() method in
HttpServletResponse.
> >
> >-- Nitin
> >-----Original Message-----
> >From: John Villar [mailto:john.villar@florhard.com]
> >Sent: Tuesday, August 31, 2004 8:32 AM
> >To: Tomcat Users List
> >Subject: Re: Reading Servlet OutputStream
> >
> >Look at the pushBody method of the response class
> >(HttpServletResponse).... that's all you need
> >
> >Nitin Mulimani escribió:
> >
> >
> >
> >>This question is is more on the Servlet API.
> >>
> >>
> >>
> >>I want to read the servlet output stream and save in some buffer or
> >>file, and then forward it to the client. I use filters to play with the
> >>Request and Response objects.
> >>
> >>
> >>
> >>These are some of the things I have tried.
> >>
> >>1)       I have a Wrapper which extends HttpServletResponseWrapper
> >>
> >>2)       Constructed a PrintWriter writer = new PrintWriter(new
> >>OutputStreamWriter(origResponse.getOutputStream(), charEnc));
> >>
> >>Reader reader = new StringReader(printWriter.toString());
> >>
> >>           BufferedReader bufferedReader = new BufferedReader(reader);
> >>
> >>           String line;
> >>
> >>           while ((line = bufferedReader.readLine()) != null) {
> >>
> >>                 System.out.println("line : " + line);
> >>
> >>           }
> >>
> >>3)             bufferedReader.close();
> >>
> >>
> >>
> >>Still am not able to read the response. I can write to the response, but
> >>am stuck at reading the response.
> >>
> >>
> >>
> >>Any pointers.
> >>
> >>
> >>
> >>-- Nitin
> >>
> >>
> >>
> >>
> >>
> >>
> >
> >
> >
>
> -- 
> John Villar
> Gerente de Proyectos
> Computadores Flor Hard Soft 2058 C.A.
> www.florhard.com
>
>
>


----------------------------------------------------------------------------
----


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



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

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



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