Skip to Content
Former Member
Nov 24, 2006 at 11:23 AM

Response.getOutputStream problem



I dont know if this question really belongs to this thread but I dont know where else to put it either...anyways, I hope you guys can help me out..

As the SAP WAS follows the Servlet Specification 2.3, I need to change my servlet to fit this specification.

The server calls the flushBuffer() on the main response object (when a forward is made), after which it is committed.

Now in my servlet, I have a temporary Storage object where I pack in the request and response. I am working on the Storage.response and I would like to set the value of the orignial Response.getOuputStream to the value of Storage.response.getOutputStream because the flushBuffer() is called on the main object (original response object).

Any ideas on how to go about it? I tried taking the value of the Storage.response.getOutputStream in a temporary OutputStream object, converted it to byte[] and tried

super.getResponse().getOutputStream().write(tempByteArray) but obviously it didnt work because it writes the content to the screen instead of setting the value of outputstream.

Any help would be greatly appriciated!