Top Description Fields Constructors Methods
com.sun.faces.application

public Class ViewHandlerResponseWrapper

extends HttpServletResponseWrapper
Class Inheritance
Imports
javax.servlet.ServletOutputStream, .ServletResponse, javax.servlet.http.HttpServletResponse, .HttpServletResponseWrapper, java.io.CharArrayWriter, .IOException, .PrintWriter, .Writer

This class is used by javax.faces.application.ViewHandler#createView to obtain the text that exists after the <f:view> tag.

Field Summary

Modifier and TypeField and Description
private ByteArrayWebOutputStream
private CharArrayWriter
private WebPrintWriter
private int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public void
flushToWriter(Writer writer, String encoding)

public byte[]
public char[]
public ServletOutputStream
getOutputStream()

Overrides javax.servlet.ServletResponseWrapper.getOutputStream.

Implements javax.servlet.ServletResponse.getOutputStream.

Returns a ServletOutputStream suitable for writing binary data in the response.
public int
getStatus()

Overrides javax.servlet.http.HttpServletResponseWrapper.getStatus.

Implements javax.servlet.http.HttpServletResponse.getStatus.

The default behaviour of this method is to call HttpServletResponse#getStatus on the wrapped response object.
public PrintWriter
getWriter()

Overrides javax.servlet.ServletResponseWrapper.getWriter.

Implements javax.servlet.ServletResponse.getWriter.

Returns a PrintWriter object that can send character text to the client.
public boolean
public boolean
public void
public void
sendError(int
the error status code
sc
,
String
the descriptive message
msg
)

Overrides javax.servlet.http.HttpServletResponseWrapper.sendError.

Implements javax.servlet.http.HttpServletResponse.sendError.

The default behavior of this method is to call sendError(int sc, String msg) on the wrapped response object.
public void
sendError(int
the error status code
sc
)

Overrides javax.servlet.http.HttpServletResponseWrapper.sendError.

Implements javax.servlet.http.HttpServletResponse.sendError.

The default behavior of this method is to call sendError(int sc) on the wrapped response object.
public void
setStatus(int
the status code
sc
)

Overrides javax.servlet.http.HttpServletResponseWrapper.setStatus.

Implements javax.servlet.http.HttpServletResponse.setStatus.

The default behavior of this method is to call setStatus(int sc) on the wrapped response object.
public void
setStatus(int
the status code
sc
,
String
the status message
sm
)

Overrides javax.servlet.http.HttpServletResponseWrapper.setStatus.

Implements javax.servlet.http.HttpServletResponse.setStatus.

The default behavior of this method is to call setStatus(int sc, String sm) on the wrapped response object.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from javax.servlet.http.HttpServletResponseWrapper:
addCookieaddDateHeaderaddHeaderaddIntHeadercontainsHeaderencodeRedirectURLencodeRedirectUrlencodeURLencodeUrlgetHeadergetHeaderNamesgetHeadersgetTrailerFieldssendRedirectsetDateHeadersetHeadersetIntHeadersetTrailerFields

Field Detail

basosback to summary
private ByteArrayWebOutputStream basos
cawback to summary
private CharArrayWriter caw
pwback to summary
private WebPrintWriter pw
statusback to summary
private int status

Constructor Detail

ViewHandlerResponseWrapperback to summary
public ViewHandlerResponseWrapper(HttpServletResponse wrapped)

Method Detail

flushContentToWrappedResponseback to summary
public void flushContentToWrappedResponse() throws IOException
flushToWriterback to summary
public void flushToWriter(Writer writer, String encoding) throws IOException
getBytesback to summary
public byte[] getBytes()
getCharsback to summary
public char[] getChars()
getOutputStreamback to summary
public ServletOutputStream getOutputStream() throws IOException

Overrides javax.servlet.ServletResponseWrapper.getOutputStream.

Implements javax.servlet.ServletResponse.getOutputStream.

Doc from javax.servlet.ServletResponse.getOutputStream.

Returns a ServletOutputStream suitable for writing binary data in the response. The servlet container does not encode the binary data.

Calling flush() on the ServletOutputStream commits the response. Either this method or getWriter may be called to write the body, not both, except when reset has been called.

Returns:ServletOutputStream

a ServletOutputStream for writing binary data

Annotations
@Override
Exceptions
IOException:
if an input or output exception occurred
getStatusback to summary
public int getStatus()

Overrides javax.servlet.http.HttpServletResponseWrapper.getStatus.

Implements javax.servlet.http.HttpServletResponse.getStatus.

Doc from javax.servlet.http.HttpServletResponseWrapper.getStatus.

The default behaviour of this method is to call HttpServletResponse#getStatus on the wrapped response object.

Returns:int

the current status code of the wrapped response

Annotations
@Override
getWriterback to summary
public PrintWriter getWriter() throws IOException

Overrides javax.servlet.ServletResponseWrapper.getWriter.

Implements javax.servlet.ServletResponse.getWriter.

Doc from javax.servlet.ServletResponse.getWriter.

Returns a PrintWriter object that can send character text to the client. The PrintWriter uses the character encoding returned by getCharacterEncoding. If the response's character encoding has not been specified as described in getCharacterEncoding (i.e., the method just returns the default value ISO-8859-1), getWriter updates it to ISO-8859-1.

Calling flush() on the PrintWriter commits the response.

Either this method or getOutputStream may be called to write the body, not both, except when reset has been called.

Returns:PrintWriter

a PrintWriter object that can return character data to the client

Annotations
@Override
Exceptions
IOException:
if an input or output exception occurred
isBytesback to summary
public boolean isBytes()
isCharsback to summary
public boolean isChars()
resetBuffersback to summary
public void resetBuffers() throws IOException
sendErrorback to summary
public void sendError(int sc, String msg) throws IOException

Overrides javax.servlet.http.HttpServletResponseWrapper.sendError.

Implements javax.servlet.http.HttpServletResponse.sendError.

Doc from javax.servlet.http.HttpServletResponseWrapper.sendError.

The default behavior of this method is to call sendError(int sc, String msg) on the wrapped response object.

Parameters
sc:int

Doc from javax.servlet.http.HttpServletResponse.sendError.

the error status code

msg:String

Doc from javax.servlet.http.HttpServletResponse.sendError.

the descriptive message

Annotations
@Override
Exceptions
IOException:

Doc from javax.servlet.http.HttpServletResponse.sendError.

If an input or output exception occurs

sendErrorback to summary
public void sendError(int sc) throws IOException

Overrides javax.servlet.http.HttpServletResponseWrapper.sendError.

Implements javax.servlet.http.HttpServletResponse.sendError.

Doc from javax.servlet.http.HttpServletResponseWrapper.sendError.

The default behavior of this method is to call sendError(int sc) on the wrapped response object.

Parameters
sc:int

Doc from javax.servlet.http.HttpServletResponse.sendError.

the error status code

Annotations
@Override
Exceptions
IOException:

Doc from javax.servlet.http.HttpServletResponse.sendError.

If an input or output exception occurs

setStatusback to summary
public void setStatus(int sc)

Overrides javax.servlet.http.HttpServletResponseWrapper.setStatus.

Implements javax.servlet.http.HttpServletResponse.setStatus.

Doc from javax.servlet.http.HttpServletResponseWrapper.setStatus.

The default behavior of this method is to call setStatus(int sc) on the wrapped response object.

Parameters
sc:int

Doc from javax.servlet.http.HttpServletResponse.setStatus.

the status code

Annotations
@Override
setStatusback to summary
public void setStatus(int sc, String sm)

Overrides javax.servlet.http.HttpServletResponseWrapper.setStatus.

Implements javax.servlet.http.HttpServletResponse.setStatus.

Doc from javax.servlet.http.HttpServletResponseWrapper.setStatus.

The default behavior of this method is to call setStatus(int sc, String sm) on the wrapped response object.

Parameters
sc:int

Doc from javax.servlet.http.HttpServletResponse.setStatus.

the status code

sm:String

Doc from javax.servlet.http.HttpServletResponse.setStatus.

the status message

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override