|
|||||||||
| 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
org.riotfamily.cachius.servlet.CachiusResponseWrapper
public class CachiusResponseWrapper
A HttpServletResponseWrapper that captures the response and updates the associated CacheItem.
| Field Summary |
|---|
| Constructor Summary | |
|---|---|
CachiusResponseWrapper(HttpServletResponse response,
CacheItem cacheItem,
SessionIdEncoder sessionIdEncoder)
|
|
| Method Summary | |
|---|---|
void |
addCookie(Cookie cookie)
|
void |
addDateHeader(String name,
long date)
|
void |
addHeader(String name,
String value)
|
void |
addIntHeader(String name,
int value)
|
String |
encodeRedirectUrl(String url)
Delegates the call to encodeRedirectURL(String). |
String |
encodeRedirectURL(String url)
Delegates the call to SessionIdEncoder.encodeRedirectURL(String)
to ensure that the session state remains the same during processing. |
String |
encodeUrl(String url)
Delegates the call to encodeURL(String). |
String |
encodeURL(String url)
Delegates the call to SessionIdEncoder.encodeURL(String)
to ensure that the session state remains the same during processing. |
void |
flushBuffer()
|
String |
getContentType()
|
ServletOutputStream |
getOutputStream()
Returns an ServletOutputStream that writes into the OutputStream provided by the CacheItem. |
PrintWriter |
getWriter()
Returns a PrintWriter that writes into the Writer provided by the CacheItem. |
boolean |
isOk()
|
void |
setContentLength(int len)
|
void |
setContentType(String contentType)
|
void |
setDateHeader(String name,
long date)
|
void |
setHeader(String name,
String value)
|
void |
setIntHeader(String name,
int value)
|
void |
setStatus(int status)
|
void |
stopCapturing()
|
void |
updateHeaders()
Sets the captured headers on the CacheItem. |
| Methods inherited from class javax.servlet.http.HttpServletResponseWrapper |
|---|
containsHeader, sendError, sendError, sendRedirect, setStatus |
| Methods inherited from class javax.servlet.ServletResponseWrapper |
|---|
getBufferSize, getCharacterEncoding, getLocale, getResponse, isCommitted, reset, resetBuffer, setBufferSize, setCharacterEncoding, setLocale, 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, isCommitted, reset, resetBuffer, setBufferSize, setCharacterEncoding, setLocale |
| Constructor Detail |
|---|
public CachiusResponseWrapper(HttpServletResponse response,
CacheItem cacheItem,
SessionIdEncoder sessionIdEncoder)
| Method Detail |
|---|
public void setStatus(int status)
setStatus in interface HttpServletResponsesetStatus in class HttpServletResponseWrapperpublic boolean isOk()
public String getContentType()
getContentType in interface ServletResponsegetContentType in class ServletResponseWrapperpublic void setContentType(String contentType)
setContentType in interface ServletResponsesetContentType in class ServletResponseWrapperpublic void setContentLength(int len)
setContentLength in interface ServletResponsesetContentLength in class ServletResponseWrapper
public void addDateHeader(String name,
long date)
addDateHeader in interface HttpServletResponseaddDateHeader in class HttpServletResponseWrapper
public void setDateHeader(String name,
long date)
setDateHeader in interface HttpServletResponsesetDateHeader in class HttpServletResponseWrapper
public void addIntHeader(String name,
int value)
addIntHeader in interface HttpServletResponseaddIntHeader in class HttpServletResponseWrapper
public void setIntHeader(String name,
int value)
setIntHeader in interface HttpServletResponsesetIntHeader in class HttpServletResponseWrapper
public void addHeader(String name,
String value)
addHeader in interface HttpServletResponseaddHeader in class HttpServletResponseWrapper
public void setHeader(String name,
String value)
setHeader in interface HttpServletResponsesetHeader in class HttpServletResponseWrapperpublic void addCookie(Cookie cookie)
addCookie in interface HttpServletResponseaddCookie in class HttpServletResponseWrapper
public ServletOutputStream getOutputStream()
throws IOException
getOutputStream in interface ServletResponsegetOutputStream in class ServletResponseWrapperIllegalStateException - If getWriter() has been called before
IOException
public PrintWriter getWriter()
throws IOException
getWriter in interface ServletResponsegetWriter in class ServletResponseWrapperIllegalStateExcepion - If getOutputStream() has been called before
IOException
public void flushBuffer()
throws IOException
flushBuffer in interface ServletResponseflushBuffer in class ServletResponseWrapperIOException
public void stopCapturing()
throws IOException
IOExceptionpublic void updateHeaders()
public String encodeRedirectURL(String url)
SessionIdEncoder.encodeRedirectURL(String)
to ensure that the session state remains the same during processing.
encodeRedirectURL in interface HttpServletResponseencodeRedirectURL in class HttpServletResponseWrapperpublic String encodeRedirectUrl(String url)
encodeRedirectURL(String).
encodeRedirectUrl in interface HttpServletResponseencodeRedirectUrl in class HttpServletResponseWrapperpublic String encodeURL(String url)
SessionIdEncoder.encodeURL(String)
to ensure that the session state remains the same during processing.
encodeURL in interface HttpServletResponseencodeURL in class HttpServletResponseWrapperpublic String encodeUrl(String url)
encodeURL(String).
encodeUrl in interface HttpServletResponseencodeUrl in class HttpServletResponseWrapper
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||