com.caucho.jsf.context
Class JspResponseWrapper

java.lang.Object
  extended by com.caucho.server.connection.ResponseWrapper
      extended by com.caucho.jsf.context.JspResponseWrapper
All Implemented Interfaces:
CauchoResponse, HttpServletResponse, ServletResponse

public class JspResponseWrapper
extends ResponseWrapper
implements CauchoResponse


Field Summary
 
Fields inherited from interface javax.servlet.http.HttpServletResponse
SC_ACCEPTED, SC_BAD_GATEWAY, SC_BAD_REQUEST, SC_CONFLICT, SC_CONTINUE, SC_CREATED, SC_EXPECTATION_FAILED, SC_FORBIDDEN, SC_FOUND, SC_GATEWAY_TIMEOUT, SC_GONE, SC_HTTP_VERSION_NOT_SUPPORTED, SC_INTERNAL_SERVER_ERROR, SC_LENGTH_REQUIRED, SC_METHOD_NOT_ALLOWED, SC_MOVED_PERMANENTLY, SC_MOVED_TEMPORARILY, SC_MULTIPLE_CHOICES, SC_NO_CONTENT, SC_NON_AUTHORITATIVE_INFORMATION, SC_NOT_ACCEPTABLE, SC_NOT_FOUND, SC_NOT_IMPLEMENTED, SC_NOT_MODIFIED, SC_OK, SC_PARTIAL_CONTENT, SC_PAYMENT_REQUIRED, SC_PRECONDITION_FAILED, SC_PROXY_AUTHENTICATION_REQUIRED, SC_REQUEST_ENTITY_TOO_LARGE, SC_REQUEST_TIMEOUT, SC_REQUEST_URI_TOO_LONG, SC_REQUESTED_RANGE_NOT_SATISFIABLE, SC_RESET_CONTENT, SC_SEE_OTHER, SC_SERVICE_UNAVAILABLE, SC_SWITCHING_PROTOCOLS, SC_UNAUTHORIZED, SC_UNSUPPORTED_MEDIA_TYPE, SC_USE_PROXY_TYPE
 
Constructor Summary
JspResponseWrapper()
           
 
Method Summary
 void clearBuffer()
           
 void close()
          complete the response.
 java.lang.String completeJsf()
           
 boolean disableHeaders(boolean disable)
           
 void flushBuffer()
          Flushes the buffer to the client.
 void flushResponse()
           
 FlushBuffer getFlushBuffer()
          Gets the flush buffer
 boolean getForbidForward()
          Returns true if RequestDispatcher.forward() is disallowed on this stream.
 java.lang.String getHeader(java.lang.String key)
           
 ServletOutputStream getOutputStream()
          Returns the servlet output stream.
 int getRemaining()
           
 AbstractResponseStream getResponseStream()
          Gets the response stream.
 int getStatusCode()
           
 java.lang.String getStatusMessage()
           
protected  java.io.OutputStream getStream()
          Returns the output stream for this wrapper.
 java.io.PrintWriter getWriter()
          Returns the print writer.
 boolean hasError()
          Returns true if we're processing an error.
 void init(HttpServletResponse response)
          Initialize the response.
 boolean isCauchoResponseStream()
          Returns true for a caucho response stream.
 void killCache()
          Kills the cache for an error.
 void resetBuffer()
          Resets the output stream without clearing headers and the output buffer.
 void setFlushBuffer(FlushBuffer flushBuffer)
          Sets the flush buffer
 void setForbidForward(boolean forbid)
          When set to true, RequestDispatcher.forward() is disallowed on this stream.
 void setHasError(boolean hasError)
          Set to true while processing an error.
 void setLocale(java.util.Locale locale)
          Sets the output locale.
 void setNoCache(boolean isPrivate)
           
 void setPrivateCache(boolean isPrivate)
           
 void setResponseStream(AbstractResponseStream stream)
          Sets the ResponseStream
 void setSessionId(java.lang.String id)
           
 
Methods inherited from class com.caucho.server.connection.ResponseWrapper
addCookie, addDateHeader, addFooter, addHeader, addIntHeader, containsHeader, disable, enable, encodeRedirectUrl, encodeRedirectURL, encodeUrl, encodeURL, getBufferSize, getCharacterEncoding, getContentType, getLocale, getResponse, isCommitted, isDisabled, reset, sendError, sendError, sendRedirect, setBufferSize, setCharacterEncoding, setContentLength, setContentType, setDateHeader, setFooter, setHeader, setIntHeader, setResponse, setStatus, setStatus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.caucho.server.connection.CauchoResponse
addFooter, setFooter
 
Methods inherited from interface javax.servlet.http.HttpServletResponse
addCookie, addDateHeader, addHeader, addIntHeader, containsHeader, encodeRedirectUrl, encodeRedirectURL, encodeUrl, encodeURL, sendError, sendError, sendRedirect, setDateHeader, setHeader, setIntHeader, setStatus, setStatus
 
Methods inherited from interface javax.servlet.ServletResponse
disable, enable, getBufferSize, getCharacterEncoding, getContentType, getLocale, isCommitted, isDisabled, reset, setBufferSize, setCharacterEncoding, setContentLength, setContentType
 

Constructor Detail

JspResponseWrapper

public JspResponseWrapper()
Method Detail

init

public void init(HttpServletResponse response)
Initialize the response.


setResponseStream

public void setResponseStream(AbstractResponseStream stream)
Sets the ResponseStream

Specified by:
setResponseStream in interface CauchoResponse

getResponseStream

public AbstractResponseStream getResponseStream()
Gets the response stream.

Specified by:
getResponseStream in interface CauchoResponse

isCauchoResponseStream

public boolean isCauchoResponseStream()
Returns true for a caucho response stream.

Specified by:
isCauchoResponseStream in interface CauchoResponse

getOutputStream

public ServletOutputStream getOutputStream()
                                    throws java.io.IOException
Returns the servlet output stream.

Specified by:
getOutputStream in interface ServletResponse
Overrides:
getOutputStream in class ResponseWrapper
Throws:
java.io.IOException

getWriter

public java.io.PrintWriter getWriter()
                              throws java.io.IOException
Returns the print writer.

Specified by:
getWriter in interface ServletResponse
Overrides:
getWriter in class ResponseWrapper
Throws:
java.io.IOException

getStream

protected java.io.OutputStream getStream()
                                  throws java.io.IOException
Returns the output stream for this wrapper.

Throws:
java.io.IOException

setFlushBuffer

public void setFlushBuffer(FlushBuffer flushBuffer)
Sets the flush buffer

Specified by:
setFlushBuffer in interface CauchoResponse

getFlushBuffer

public FlushBuffer getFlushBuffer()
Gets the flush buffer

Specified by:
getFlushBuffer in interface CauchoResponse

flushBuffer

public void flushBuffer()
                 throws java.io.IOException
Description copied from class: ResponseWrapper
Flushes the buffer to the client.

Specified by:
flushBuffer in interface ServletResponse
Overrides:
flushBuffer in class ResponseWrapper
Throws:
java.io.IOException

resetBuffer

public void resetBuffer()
Description copied from class: ResponseWrapper
Resets the output stream without clearing headers and the output buffer. Calling resetBuffer() after data has been committed is illegal.

Specified by:
resetBuffer in interface ServletResponse
Overrides:
resetBuffer in class ResponseWrapper

clearBuffer

public void clearBuffer()

setLocale

public void setLocale(java.util.Locale locale)
Description copied from class: ResponseWrapper
Sets the output locale. The response will set the character encoding based on the locale. For example, setting the "kr" locale will set the character encoding to "EUC_KR".

Specified by:
setLocale in interface ServletResponse
Overrides:
setLocale in class ResponseWrapper

getHeader

public java.lang.String getHeader(java.lang.String key)
Specified by:
getHeader in interface CauchoResponse

disableHeaders

public boolean disableHeaders(boolean disable)
Specified by:
disableHeaders in interface CauchoResponse

getRemaining

public int getRemaining()

setForbidForward

public void setForbidForward(boolean forbid)
When set to true, RequestDispatcher.forward() is disallowed on this stream.

Specified by:
setForbidForward in interface CauchoResponse

getForbidForward

public boolean getForbidForward()
Returns true if RequestDispatcher.forward() is disallowed on this stream.

Specified by:
getForbidForward in interface CauchoResponse

setHasError

public void setHasError(boolean hasError)
Set to true while processing an error.

Specified by:
setHasError in interface CauchoResponse

getStatusCode

public int getStatusCode()
Specified by:
getStatusCode in interface CauchoResponse

getStatusMessage

public java.lang.String getStatusMessage()
Specified by:
getStatusMessage in interface CauchoResponse

hasError

public boolean hasError()
Returns true if we're processing an error.

Specified by:
hasError in interface CauchoResponse

killCache

public void killCache()
Kills the cache for an error.

Specified by:
killCache in interface CauchoResponse

setSessionId

public void setSessionId(java.lang.String id)
Specified by:
setSessionId in interface CauchoResponse

setPrivateCache

public void setPrivateCache(boolean isPrivate)
Specified by:
setPrivateCache in interface CauchoResponse

setNoCache

public void setNoCache(boolean isPrivate)
Specified by:
setNoCache in interface CauchoResponse

close

public void close()
           throws java.io.IOException
complete the response.

Specified by:
close in interface CauchoResponse
Throws:
java.io.IOException

flushResponse

public void flushResponse()
                   throws java.io.IOException
Throws:
java.io.IOException

completeJsf

public java.lang.String completeJsf()
                             throws java.io.IOException
Throws:
java.io.IOException