org.apache.commons.workflow.web
Class IncludeResponse23

java.lang.Object
  extended byjavax.servlet.ServletResponseWrapper
      extended byorg.apache.commons.workflow.web.IncludeResponse23
All Implemented Interfaces:
javax.servlet.ServletResponse

public class IncludeResponse23
extends javax.servlet.ServletResponseWrapper

Implementation of HttpServletResponseWrapper for use in IncludeStep23. It buffers the response characters up into a memory-resident buffer that can be converted into a String by calling getContent().

Version:
$Revision: 1.3 $ $Date: 2004/02/28 03:35:55 $

Field Summary
protected  java.io.ByteArrayOutputStream baos
          Accumulator for output that is generated via getOutputStream().
protected  java.io.CharArrayWriter caw
          Accumulator for output that is generated via getWriter().
 
Constructor Summary
IncludeResponse23(javax.servlet.ServletResponse response)
          Construct a new response wrapper according to the specified parameters.
 
Method Summary
 void flushBuffer()
          Swallow any attempt to flush the response buffer.
 java.lang.String getCharacterEncoding()
          Return the character encoding for the included response (if any).
 java.lang.String getContent()
          Return the response data written to this response as a String.
 javax.servlet.ServletOutputStream getOutputStream()
          Return a ServletOutputStream that can be used to accumulate the response data for the included resource.
 java.io.PrintWriter getWriter()
          Return a PrintWriter that can be used to accumulate the response data for the included resource.
 void reset()
          Reset the response buffer and all headers.
 void resetBuffer()
          Reset the response buffer to contain no data.
 void setContentType(java.lang.String contentType)
          Set the content type (and possibly the character encoding) of the response data.
 
Methods inherited from class javax.servlet.ServletResponseWrapper
getBufferSize, getLocale, getResponse, isCommitted, setBufferSize, setContentLength, setLocale, setResponse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

baos

protected java.io.ByteArrayOutputStream baos
Accumulator for output that is generated via getOutputStream().


caw

protected java.io.CharArrayWriter caw
Accumulator for output that is generated via getWriter().

Constructor Detail

IncludeResponse23

public IncludeResponse23(javax.servlet.ServletResponse response)
Construct a new response wrapper according to the specified parameters.

Parameters:
response - The servlet response we are wrapping
Method Detail

flushBuffer

public void flushBuffer()
                 throws java.io.IOException
Swallow any attempt to flush the response buffer.

Throws:
java.io.IOException

getCharacterEncoding

public java.lang.String getCharacterEncoding()
Return the character encoding for the included response (if any).


getContent

public java.lang.String getContent()
                            throws java.io.IOException
Return the response data written to this response as a String.

Throws:
java.io.IOException - if a conversion error occurs

getOutputStream

public javax.servlet.ServletOutputStream getOutputStream()
                                                  throws java.io.IOException
Return a ServletOutputStream that can be used to accumulate the response data for the included resource.

Throws:
java.io.IOException - if an I/O error occurs

getWriter

public java.io.PrintWriter getWriter()
                              throws java.io.IOException
Return a PrintWriter that can be used to accumulate the response data for the included resource.

Throws:
java.io.IOException - if an I/O error occurs

reset

public void reset()
Reset the response buffer and all headers.


resetBuffer

public void resetBuffer()
Reset the response buffer to contain no data.


setContentType

public void setContentType(java.lang.String contentType)
Set the content type (and possibly the character encoding) of the response data.

Parameters:
contentType - The new content type


Copyright © 2001-2005 The Apache Software Foundation. All Rights Reserved.