tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kaleb Pederson <>
Subject Subclassing ServletOutputStream/PrintWriter
Date Mon, 02 Aug 2004 22:25:29 GMT
I'm receiving a committed response object in an Servlet that I wrote.  As the 
response is committed, as far as I can tell, I need to create a custom 
HttpServletResponseWrapper. But as the response object is committed, it needs 
to use a new print writer or output stream.  So, as far as I can tell I need 
to do the following steps:

1) Subclass HttpServletResponse wrapper which overrides getWriter() and 
2) Subclass PrintWriter (so getWriter will return a non-committed object)
3) Subclass ServletOutputStream (so getOutputStream will return a 
non-committed object.)

Although I know write(int) needs to be implemented by ServletOutputStream, I 
don't see how that would be nearly sufficient?  How does Tomcat get at the 
buffer associated with an output stream so that it can send it to the client?  
What should my required steps be?

Thanks for the help.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message