com.caucho.server.webapp
Class DispatchResponse

java.lang.Object
  extended by com.caucho.server.http.ResponseWrapper
      extended by com.caucho.server.http.ResponseAdapter
          extended by com.caucho.server.webapp.DispatchResponse
All Implemented Interfaces:
CauchoResponse, HttpServletResponse, ServletResponse

public class DispatchResponse
extends ResponseAdapter


Field Summary
 
Fields inherited from class com.caucho.server.http.ResponseWrapper
_response
 
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_TEMPORARY_REDIRECT, SC_UNAUTHORIZED, SC_UNSUPPORTED_MEDIA_TYPE, SC_USE_PROXY
 
Constructor Summary
DispatchResponse()
           
 
Method Summary
 void addDateHeader(java.lang.String name, long date)
          Adds a header by converting a date to a string.
 void addHeader(java.lang.String name, java.lang.String value)
          Adds a header.
 void addIntHeader(java.lang.String name, int value)
          Adds a header by converting an integer value to a string.
 void setDateHeader(java.lang.String name, long date)
          Sets a header by converting a date to a string.
 void setHeader(java.lang.String name, java.lang.String value)
          Sets a header.
 void setIntHeader(java.lang.String name, int value)
          Sets a header by converting an integer value to a string.
 java.lang.String toString()
           
 
Methods inherited from class com.caucho.server.http.ResponseAdapter
addCookie, addFooter, close, completeCache, create, createWrapperResponseStream, disableHeaders, finish, free, free, getBufferSize, getCauchoResponse, getFlushBuffer, getForbidForward, getHeader, getHeaderNames, getHeaders, getOutputStream, getRemaining, getResponseStream, getStatus, getStatusMessage, getWriter, hasError, init, isCauchoResponseStream, isForwardEnclosed, isNoCacheUnlessVary, isTop, killCache, resetBuffer, sendRedirect, setBufferSize, setContentType, setFlushBuffer, setFooter, setForbidForward, setForwardEnclosed, setHasError, setNoCache, setPrivateCache, setResponseStream, setSessionId, writeHeaders
 
Methods inherited from class com.caucho.server.http.ResponseWrapper
containsHeader, disable, enable, encodeRedirectUrl, encodeRedirectURL, encodeUrl, encodeURL, flushBuffer, getAbstractHttpResponse, getCharacterEncoding, getContentType, getLocale, getResponse, isCommitted, isDisabled, reset, sendError, sendError, setCacheInvocation, setCharacterEncoding, setContentLength, setLocale, setMatchCacheEntry, setResponse, setStatus, setStatus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.caucho.server.http.CauchoResponse
getAbstractHttpResponse, getResponse, setCacheInvocation
 
Methods inherited from interface javax.servlet.http.HttpServletResponse
containsHeader, encodeRedirectUrl, encodeRedirectURL, encodeUrl, encodeURL, sendError, sendError, setStatus, setStatus
 
Methods inherited from interface javax.servlet.ServletResponse
flushBuffer, getCharacterEncoding, getContentType, getLocale, isCommitted, reset, setCharacterEncoding, setContentLength, setLocale
 

Constructor Detail

DispatchResponse

public DispatchResponse()
Method Detail

setDateHeader

public void setDateHeader(java.lang.String name,
                          long date)
Description copied from class: ResponseWrapper
Sets a header by converting a date to a string.

To set the page to expire in 15 seconds use the following:


 long now = System.currentTime();
 _response.setDateHeader("Expires", now + 15000);
 

Specified by:
setDateHeader in interface HttpServletResponse
Overrides:
setDateHeader in class ResponseWrapper
Parameters:
name - name of the header
date - the date in milliseconds since the epoch.

setHeader

public void setHeader(java.lang.String name,
                      java.lang.String value)
Description copied from class: ResponseWrapper
Sets a header. This will override a previous header with the same name.

Specified by:
setHeader in interface HttpServletResponse
Overrides:
setHeader in class ResponseWrapper
Parameters:
name - the header name
value - the header value

addHeader

public void addHeader(java.lang.String name,
                      java.lang.String value)
Description copied from class: ResponseWrapper
Adds a header. If another header with the same name exists, both will be sent to the client.

Specified by:
addHeader in interface HttpServletResponse
Overrides:
addHeader in class ResponseWrapper
Parameters:
name - the header name
value - the header value

addDateHeader

public void addDateHeader(java.lang.String name,
                          long date)
Description copied from class: ResponseWrapper
Adds a header by converting a date to a string.

Specified by:
addDateHeader in interface HttpServletResponse
Overrides:
addDateHeader in class ResponseWrapper
Parameters:
name - name of the header
date - the date in milliseconds since the epoch.

addIntHeader

public void addIntHeader(java.lang.String name,
                         int value)
Description copied from class: ResponseWrapper
Adds a header by converting an integer value to a string.

Specified by:
addIntHeader in interface HttpServletResponse
Overrides:
addIntHeader in class ResponseWrapper
Parameters:
name - name of the header
value - the value as an integer

setIntHeader

public void setIntHeader(java.lang.String name,
                         int value)
Description copied from class: ResponseWrapper
Sets a header by converting an integer value to a string.

Specified by:
setIntHeader in interface HttpServletResponse
Overrides:
setIntHeader in class ResponseWrapper
Parameters:
name - name of the header
value - the value as an integer

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object