|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.servlet.ServletResponseWrapper
javax.servlet.http.HttpServletResponseWrapper
com.sun.appserv.web.cache.filter.CachingResponseWrapper
public class CachingResponseWrapper
a wrapper to HttpServletResponse to cache the outbound headers and content
and,
HttpServletResponse| 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_TEMPORARY_REDIRECT, SC_UNAUTHORIZED, SC_UNSUPPORTED_MEDIA_TYPE, SC_USE_PROXY |
| Constructor Summary | |
|---|---|
CachingResponseWrapper(javax.servlet.http.HttpServletResponse response)
Constructs a response adaptor wrapping the given response. |
|
| Method Summary | |
|---|---|
void |
addCookie(javax.servlet.http.Cookie cookie)
The default behavior of this method is to call addCookie(Cookie cookie) on the wrapped response object. |
void |
addDateHeader(java.lang.String name,
long value)
Add the specified date header to the specified value. |
void |
addHeader(java.lang.String name,
java.lang.String value)
Add the specified header to the specified value. |
void |
addIntHeader(java.lang.String name,
int value)
Add the specified integer header to the specified value. |
HttpCacheEntry |
cacheResponse()
called by doFilter to cache the response that was just sent out |
void |
clear()
clear the contents of this wrapper |
java.lang.Long |
getExpiresDateHeader()
return the Expires: date header value |
javax.servlet.ServletOutputStream |
getOutputStream()
Return the servlet output stream associated with this Response. |
java.io.PrintWriter |
getWriter()
Return the writer associated with this Response. |
boolean |
isError()
has the response been set to error |
void |
sendError(int status)
Send an error response with the specified status and a default message. |
void |
sendError(int status,
java.lang.String message)
Send an error response with the specified status and message. |
void |
setContentLength(int len)
Set the content length (in bytes) for this Response. |
void |
setContentType(java.lang.String type)
Set the content type for this Response. |
void |
setDateHeader(java.lang.String name,
long value)
Set the specified date header to the specified value. |
void |
setHeader(java.lang.String name,
java.lang.String value)
Set the specified header to the specified value. |
void |
setIntHeader(java.lang.String name,
int value)
Set the specified integer header to the specified value. |
void |
setLocale(java.util.Locale locale)
Set the Locale that is appropriate for this response, including setting the appropriate character encoding. |
void |
setStatus(int sc)
Set the HTTP status to be returned with this response. |
| Methods inherited from class javax.servlet.http.HttpServletResponseWrapper |
|---|
containsHeader, encodeRedirectUrl, encodeRedirectURL, encodeUrl, encodeURL, getHeader, getHeaderNames, getHeaders, getStatus, sendRedirect, setStatus |
| Methods inherited from class javax.servlet.ServletResponseWrapper |
|---|
flushBuffer, getBufferSize, getCharacterEncoding, getContentType, getLocale, getResponse, isCommitted, isWrapperFor, isWrapperFor, reset, resetBuffer, setBufferSize, setCharacterEncoding, setResponse |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.servlet.ServletResponse |
|---|
flushBuffer, getBufferSize, getCharacterEncoding, getContentType, getLocale, isCommitted, reset, resetBuffer, setBufferSize, setCharacterEncoding |
| Constructor Detail |
|---|
public CachingResponseWrapper(javax.servlet.http.HttpServletResponse response)
java.lang.IllegalArgumentException - if the response is null| Method Detail |
|---|
public javax.servlet.ServletOutputStream getOutputStream()
throws java.io.IOException
getOutputStream in interface javax.servlet.ServletResponsegetOutputStream in class javax.servlet.ServletResponseWrapperjava.lang.IllegalStateException - if getWriter has
already been called for this response
java.io.IOException - if an input/output error occurs
public java.io.PrintWriter getWriter()
throws java.io.IOException
getWriter in interface javax.servlet.ServletResponsegetWriter in class javax.servlet.ServletResponseWrapperjava.lang.IllegalStateException - if getOutputStream has
already been called for this response
java.io.IOException - if an input/output error occurspublic void setContentLength(int len)
setContentLength in interface javax.servlet.ServletResponsesetContentLength in class javax.servlet.ServletResponseWrapperlen - The new content lengthpublic void setContentType(java.lang.String type)
setContentType in interface javax.servlet.ServletResponsesetContentType in class javax.servlet.ServletResponseWrappertype - The new content typepublic void setLocale(java.util.Locale locale)
setLocale in interface javax.servlet.ServletResponsesetLocale in class javax.servlet.ServletResponseWrapperlocale - The new localepublic void addCookie(javax.servlet.http.Cookie cookie)
addCookie in interface javax.servlet.http.HttpServletResponseaddCookie in class javax.servlet.http.HttpServletResponseWrapper
public void setHeader(java.lang.String name,
java.lang.String value)
setHeader in interface javax.servlet.http.HttpServletResponsesetHeader in class javax.servlet.http.HttpServletResponseWrappername - Name of the header to setvalue - Value to be set
public void setIntHeader(java.lang.String name,
int value)
setIntHeader in interface javax.servlet.http.HttpServletResponsesetIntHeader in class javax.servlet.http.HttpServletResponseWrappername - Name of the header to setvalue - Integer value to be set
public void addHeader(java.lang.String name,
java.lang.String value)
addHeader in interface javax.servlet.http.HttpServletResponseaddHeader in class javax.servlet.http.HttpServletResponseWrappername - Name of the header to setvalue - Value to be set
public void addIntHeader(java.lang.String name,
int value)
addIntHeader in interface javax.servlet.http.HttpServletResponseaddIntHeader in class javax.servlet.http.HttpServletResponseWrappername - Name of the header to setvalue - Integer value to be set
public void setDateHeader(java.lang.String name,
long value)
setDateHeader in interface javax.servlet.http.HttpServletResponsesetDateHeader in class javax.servlet.http.HttpServletResponseWrappername - Name of the header to setvalue - Date value to be set
public void addDateHeader(java.lang.String name,
long value)
addDateHeader in interface javax.servlet.http.HttpServletResponseaddDateHeader in class javax.servlet.http.HttpServletResponseWrappername - Name of the header to setvalue - Date value to be setpublic void setStatus(int sc)
setStatus in interface javax.servlet.http.HttpServletResponsesetStatus in class javax.servlet.http.HttpServletResponseWrappersc - The new HTTP status
public void sendError(int status)
throws java.io.IOException
sendError in interface javax.servlet.http.HttpServletResponsesendError in class javax.servlet.http.HttpServletResponseWrapperstatus - HTTP status code to send
java.lang.IllegalStateException - if this response has
already been committed
java.io.IOException - if an input/output error occurs
public void sendError(int status,
java.lang.String message)
throws java.io.IOException
sendError in interface javax.servlet.http.HttpServletResponsesendError in class javax.servlet.http.HttpServletResponseWrapperstatus - HTTP status code to sendmessage - Corresponding message to send
java.lang.IllegalStateException - if this response has
already been committed
java.io.IOException - if an input/output error occurspublic boolean isError()
public java.lang.Long getExpiresDateHeader()
public HttpCacheEntry cacheResponse()
throws java.io.IOException
java.io.IOExceptionpublic void clear()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||