org.apache.catalina.ssi

Class ResponseIncludeWrapper


public class ResponseIncludeWrapper
extends HttpServletResponseWrapper

A HttpServletResponseWrapper, used from SSIServletExternalResolver

Version:
$Revision: 1.4.2.1 $, $Date: 2004/09/01 16:31:01 $

Author:
Bip Thelin

Field Summary

protected ServletOutputStream
originalServletOutputStream
Our ServletOutputStream
protected PrintWriter
printWriter
protected ServletOutputStream
servletOutputStream

Constructor Summary

ResponseIncludeWrapper(HttpServletResponse res, ServletOutputStream originalServletOutputStream)
Initialize our wrapper with the current HttpServletResponse and ServletOutputStream.

Method Summary

void
flushOutputStreamOrWriter()
Flush the servletOutputStream or printWriter ( only one will be non-null ) This must be called after a requestDispatcher.include, since we can't assume that the included servlet flushed its stream.
ServletOutputStream
getOutputStream()
Return a OutputStream, throws and exception if a printwriter already been returned.
PrintWriter
getWriter()
Return a printwriter, throws and exception if a OutputStream already been returned.

Field Details

originalServletOutputStream

protected ServletOutputStream originalServletOutputStream
Our ServletOutputStream


printWriter

protected PrintWriter printWriter


servletOutputStream

protected ServletOutputStream servletOutputStream

Constructor Details

ResponseIncludeWrapper

public ResponseIncludeWrapper(HttpServletResponse res,
                              ServletOutputStream originalServletOutputStream)
Initialize our wrapper with the current HttpServletResponse and ServletOutputStream.

Parameters:
res - The HttpServletResponse to use

Method Details

flushOutputStreamOrWriter

public void flushOutputStreamOrWriter()
            throws IOException
Flush the servletOutputStream or printWriter ( only one will be non-null ) This must be called after a requestDispatcher.include, since we can't assume that the included servlet flushed its stream.


getOutputStream

public ServletOutputStream getOutputStream()
            throws java.io.IOException
Return a OutputStream, throws and exception if a printwriter already been returned.

Returns:
a OutputStream object


getWriter

public PrintWriter getWriter()
            throws java.io.IOException
Return a printwriter, throws and exception if a OutputStream already been returned.

Returns:
a PrintWriter object


Copyright B) 2000-2003 Apache Software Foundation. All Rights Reserved.