|
||||||||||
| 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.opensymphony.oscache.web.filter.CacheHttpServletResponseWrapper
public class CacheHttpServletResponseWrapper
CacheServletResponse is a serialized representation of a response
| Field Summary |
|---|
| Constructor Summary | |
|---|---|
CacheHttpServletResponseWrapper(HttpServletResponse response)
Constructor |
|
CacheHttpServletResponseWrapper(HttpServletResponse response,
boolean fragment,
long time,
long lastModified,
long expires,
long cacheControl)
Constructor |
|
| Method Summary | |
|---|---|
void |
addDateHeader(String name,
long value)
Add the date of a header |
void |
addHeader(String name,
String value)
Add a header field |
void |
flushBuffer()
|
ResponseContent |
getContent()
Get a response content |
ServletOutputStream |
getOutputStream()
Get an output stream |
int |
getStatus()
Retrieves the captured HttpResponse status. |
PrintWriter |
getWriter()
Get a print writer |
boolean |
isCommitted()
Returns a boolean indicating if the response has been committed. |
void |
reset()
Clears any data that exists in the buffer as well as the status code and headers. |
void |
resetBuffer()
Clears the content of the underlying buffer in the response without clearing headers or status code. |
void |
sendError(int status)
We override this so we can catch the response status. |
void |
sendError(int status,
String string)
We override this so we can catch the response status. |
void |
sendRedirect(String location)
We override this so we can catch the response status. |
void |
setContentType(String value)
Set the content type |
void |
setDateHeader(String name,
long value)
Set the date of a header |
void |
setHeader(String name,
String value)
Set a header field |
void |
setIntHeader(String name,
int value)
Set the int value of the header |
void |
setLocale(Locale value)
Set the locale |
void |
setStatus(int status)
We override this so we can catch the response status. |
void |
setStatus(int status,
String string)
We override this so we can catch the response status. |
| Methods inherited from class javax.servlet.http.HttpServletResponseWrapper |
|---|
addCookie, addIntHeader, containsHeader, encodeRedirectUrl, encodeRedirectURL, encodeUrl, encodeURL |
| Methods inherited from class javax.servlet.ServletResponseWrapper |
|---|
getBufferSize, getCharacterEncoding, getLocale, getResponse, setBufferSize, setContentLength, 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 |
|---|
getBufferSize, getCharacterEncoding, getLocale, setBufferSize, setContentLength |
| Constructor Detail |
|---|
public CacheHttpServletResponseWrapper(HttpServletResponse response)
response - The servlet response
public CacheHttpServletResponseWrapper(HttpServletResponse response,
boolean fragment,
long time,
long lastModified,
long expires,
long cacheControl)
response - The servlet responsefragment - true if the repsonse indicates that it is a fragement of a pagetime - the refresh time in millislastModified - defines if last modified header will be send, @see CacheFilterexpires - defines if expires header will be send, @see CacheFiltercacheControl - defines if cache control header will be send, @see CacheFilter| Method Detail |
|---|
public ResponseContent getContent()
public void setContentType(String value)
setContentType in interface ServletResponsesetContentType in class ServletResponseWrappervalue - The content type
public void setDateHeader(String name,
long value)
setDateHeader in interface HttpServletResponsesetDateHeader in class HttpServletResponseWrappername - The header namevalue - The date
public void addDateHeader(String name,
long value)
addDateHeader in interface HttpServletResponseaddDateHeader in class HttpServletResponseWrappername - The header namevalue - The date
public void setHeader(String name,
String value)
setHeader in interface HttpServletResponsesetHeader in class HttpServletResponseWrappername - The header namevalue - The header value
public void addHeader(String name,
String value)
addHeader in interface HttpServletResponseaddHeader in class HttpServletResponseWrappername - The header namevalue - The header value
public void setIntHeader(String name,
int value)
setIntHeader in interface HttpServletResponsesetIntHeader in class HttpServletResponseWrappername - The header namevalue - The int valuepublic void setStatus(int status)
SC_OK) will
be cached.
setStatus in interface HttpServletResponsesetStatus in class HttpServletResponseWrapper
public void sendError(int status,
String string)
throws IOException
SC_OK) will
be cached.
sendError in interface HttpServletResponsesendError in class HttpServletResponseWrapperIOException
public void sendError(int status)
throws IOException
SC_OK) will
be cached.
sendError in interface HttpServletResponsesendError in class HttpServletResponseWrapperIOException
public void setStatus(int status,
String string)
SC_OK) will
be cached.
setStatus in interface HttpServletResponsesetStatus in class HttpServletResponseWrapper
public void sendRedirect(String location)
throws IOException
SC_OK) will
be cached.
sendRedirect in interface HttpServletResponsesendRedirect in class HttpServletResponseWrapperIOExceptionpublic int getStatus()
public void setLocale(Locale value)
setLocale in interface ServletResponsesetLocale in class ServletResponseWrappervalue - The locale
public ServletOutputStream getOutputStream()
throws IOException
getOutputStream in interface ServletResponsegetOutputStream in class ServletResponseWrapperIOException
public PrintWriter getWriter()
throws IOException
getWriter in interface ServletResponsegetWriter in class ServletResponseWrapperIOException
public void flushBuffer()
throws IOException
flushBuffer in interface ServletResponseflushBuffer in class ServletResponseWrapperIOExceptionpublic boolean isCommitted()
isCommitted in interface ServletResponseisCommitted in class ServletResponseWrapperServletResponseWrapper.isCommitted()public void reset()
reset in interface ServletResponsereset in class ServletResponseWrapperServletResponseWrapper.reset()public void resetBuffer()
resetBuffer in interface ServletResponseresetBuffer in class ServletResponseWrapperServletResponseWrapper.resetBuffer()
|
OSCache Project Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||