|
|||||||||
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 HttpServletResponse
setStatus
in class HttpServletResponseWrapper
public boolean isOk()
public String getContentType()
getContentType
in interface ServletResponse
getContentType
in class ServletResponseWrapper
public void setContentType(String contentType)
setContentType
in interface ServletResponse
setContentType
in class ServletResponseWrapper
public void setContentLength(int len)
setContentLength
in interface ServletResponse
setContentLength
in class ServletResponseWrapper
public void addDateHeader(String name, long date)
addDateHeader
in interface HttpServletResponse
addDateHeader
in class HttpServletResponseWrapper
public void setDateHeader(String name, long date)
setDateHeader
in interface HttpServletResponse
setDateHeader
in class HttpServletResponseWrapper
public void addIntHeader(String name, int value)
addIntHeader
in interface HttpServletResponse
addIntHeader
in class HttpServletResponseWrapper
public void setIntHeader(String name, int value)
setIntHeader
in interface HttpServletResponse
setIntHeader
in class HttpServletResponseWrapper
public void addHeader(String name, String value)
addHeader
in interface HttpServletResponse
addHeader
in class HttpServletResponseWrapper
public void setHeader(String name, String value)
setHeader
in interface HttpServletResponse
setHeader
in class HttpServletResponseWrapper
public void addCookie(Cookie cookie)
addCookie
in interface HttpServletResponse
addCookie
in class HttpServletResponseWrapper
public ServletOutputStream getOutputStream() throws IOException
getOutputStream
in interface ServletResponse
getOutputStream
in class ServletResponseWrapper
IllegalStateException
- If getWriter() has been called before
IOException
public PrintWriter getWriter() throws IOException
getWriter
in interface ServletResponse
getWriter
in class ServletResponseWrapper
IllegalStateExcepion
- If getOutputStream() has been called before
IOException
public void flushBuffer() throws IOException
flushBuffer
in interface ServletResponse
flushBuffer
in class ServletResponseWrapper
IOException
public void stopCapturing() throws IOException
IOException
public void updateHeaders()
public String encodeRedirectURL(String url)
SessionIdEncoder.encodeRedirectURL(String)
to ensure that the session state remains the same during processing.
encodeRedirectURL
in interface HttpServletResponse
encodeRedirectURL
in class HttpServletResponseWrapper
public String encodeRedirectUrl(String url)
encodeRedirectURL(String)
.
encodeRedirectUrl
in interface HttpServletResponse
encodeRedirectUrl
in class HttpServletResponseWrapper
public String encodeURL(String url)
SessionIdEncoder.encodeURL(String)
to ensure that the session state remains the same during processing.
encodeURL
in interface HttpServletResponse
encodeURL
in class HttpServletResponseWrapper
public String encodeUrl(String url)
encodeURL(String)
.
encodeUrl
in interface HttpServletResponse
encodeUrl
in class HttpServletResponseWrapper
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |