|
||||||||||
| 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.opencms.flex.CmsFlexResponse
public class CmsFlexResponse
Wrapper class for a HttpServletResponse.
This class wrapps the standard HttpServletResponse so that it's output can be delivered to the CmsFlexCache.
| Field Summary | |
|---|---|
static char |
FLEX_CACHE_DELIMITER
The cache delimiter char. |
protected static org.apache.commons.logging.Log |
LOG
The log object for this class. |
static String |
SET_HEADER
Static string to indicate a header is "set" in the header maps. |
| Constructor Summary | |
|---|---|
CmsFlexResponse(HttpServletResponse res,
CmsFlexController controller)
Constructor for the CmsFlexResponse, this variation one is usually used to wrap responses for further include calls in OpenCms. |
|
CmsFlexResponse(HttpServletResponse res,
CmsFlexController controller,
boolean streaming,
boolean isTopElement)
Constructor for the CmsFlexResponse, this variation is usually used for the "top" response. |
|
| Method Summary | |
|---|---|
void |
addCookie(Cookie cookie)
Method overloaded from the standard HttpServletRequest API. |
void |
addDateHeader(String name,
long date)
Method overlodad from the standard HttpServletRequest API. |
void |
addHeader(String name,
String value)
Method overlodad from the standard HttpServletRequest API. |
void |
addIntHeader(String name,
int value)
Method overlodad from the standard HttpServletRequest API. |
void |
addToIncludeList(String target,
Map parameterMap)
Adds an inclusion target to the list of include results. |
String |
getEncoding()
Returns the value of the encoding used for this response. |
Map |
getHeaders()
Provides access to the header cache of the top wrapper. |
ServletOutputStream |
getOutputStream()
Method overlodad from the standard HttpServletRequest API. |
PrintWriter |
getWriter()
Method overlodad from the standard HttpServletRequest API. |
byte[] |
getWriterBytes()
Returns the bytes that have been written on the current writers output stream. |
boolean |
isSuspended()
This flag indicates if the response is suspended or not. |
boolean |
isTopElement()
Returns true if this response has been constructed for the
top level element of this request, false if it was
constructed for an included sub-element. |
static void |
processHeaders(Map headers,
HttpServletResponse res)
Process the headers stored in the provided map and add them to the response. |
void |
sendRedirect(String location)
Method overlodad from the standard HttpServletRequest API. |
void |
setContentType(String type)
Method overlodad from the standard HttpServletRequest API. |
void |
setDateHeader(String name,
long date)
Method overlodad from the standard HttpServletRequest API. |
void |
setHeader(String name,
String value)
Method overlodad from the standard HttpServletRequest API. |
void |
setIntHeader(String name,
int value)
Method overlodad from the standard HttpServletRequest API. |
void |
setOnlyBuffering(boolean value)
Sets buffering status of the response. |
| Methods inherited from class javax.servlet.http.HttpServletResponseWrapper |
|---|
containsHeader, encodeRedirectUrl, encodeRedirectURL, encodeUrl, encodeURL, sendError, sendError, setStatus, setStatus |
| Methods inherited from class javax.servlet.ServletResponseWrapper |
|---|
flushBuffer, getBufferSize, getCharacterEncoding, getLocale, getResponse, isCommitted, reset, resetBuffer, setBufferSize, setContentLength, 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 |
|---|
flushBuffer, getBufferSize, getCharacterEncoding, getLocale, isCommitted, reset, resetBuffer, setBufferSize, setContentLength, setLocale |
| Field Detail |
|---|
public static final char FLEX_CACHE_DELIMITER
public static final String SET_HEADER
protected static final org.apache.commons.logging.Log LOG
| Constructor Detail |
|---|
public CmsFlexResponse(HttpServletResponse res,
CmsFlexController controller)
res - the CmsFlexResponse to wrapcontroller - the controller to use
public CmsFlexResponse(HttpServletResponse res,
CmsFlexController controller,
boolean streaming,
boolean isTopElement)
res - the HttpServletResponse to wrapcontroller - the controller to usestreaming - indicates if streaming should be enabled or notisTopElement - indicates if this is the top element of an include cascade| Method Detail |
|---|
public static void processHeaders(Map headers,
HttpServletResponse res)
headers - the headers to addres - the resonse to add the headers topublic void addCookie(Cookie cookie)
Cookies must be set directly as a header, otherwise they might not be set in the super class.
addCookie in interface HttpServletResponseaddCookie in class HttpServletResponseWrapperHttpServletResponseWrapper.addCookie(javax.servlet.http.Cookie)
public void addDateHeader(String name,
long date)
addDateHeader in interface HttpServletResponseaddDateHeader in class HttpServletResponseWrapperHttpServletResponse.addDateHeader(java.lang.String, long)
public void addHeader(String name,
String value)
addHeader in interface HttpServletResponseaddHeader in class HttpServletResponseWrapperHttpServletResponse.addHeader(java.lang.String, java.lang.String)
public void addIntHeader(String name,
int value)
addIntHeader in interface HttpServletResponseaddIntHeader in class HttpServletResponseWrapperHttpServletResponse.addIntHeader(java.lang.String, int)
public void addToIncludeList(String target,
Map parameterMap)
Should be used only in inclusion-scenarios like the JSP cms:include tag processing.
target - the include target name to addparameterMap - the map of parameters given with the include commandpublic String getEncoding()
public Map getHeaders()
public ServletOutputStream getOutputStream()
throws IOException
getOutputStream in interface ServletResponsegetOutputStream in class ServletResponseWrapperIOExceptionServletResponse.getOutputStream()
public PrintWriter getWriter()
throws IOException
getWriter in interface ServletResponsegetWriter in class ServletResponseWrapperIOExceptionServletResponse.getWriter()public byte[] getWriterBytes()
public boolean isSuspended()
A suspended response mut not write further output to any stream or process a cache entry for itself.
Currently, a response is only suspended if it is redirected.
public boolean isTopElement()
true if this response has been constructed for the
top level element of this request, false if it was
constructed for an included sub-element.
true if this response has been constructed for the
top level element of this request, false if it was
constructed for an included sub-element.
public void sendRedirect(String location)
throws IOException
sendRedirect in interface HttpServletResponsesendRedirect in class HttpServletResponseWrapperIOExceptionHttpServletResponse.sendRedirect(java.lang.String)public void setContentType(String type)
setContentType in interface ServletResponsesetContentType in class ServletResponseWrapperServletResponse.setContentType(java.lang.String)
public void setDateHeader(String name,
long date)
setDateHeader in interface HttpServletResponsesetDateHeader in class HttpServletResponseWrapperHttpServletResponse.setDateHeader(java.lang.String, long)
public void setHeader(String name,
String value)
setHeader in interface HttpServletResponsesetHeader in class HttpServletResponseWrapperHttpServletResponse.setHeader(java.lang.String, java.lang.String)
public void setIntHeader(String name,
int value)
setIntHeader in interface HttpServletResponsesetIntHeader in class HttpServletResponseWrapperHttpServletResponse.setIntHeader(java.lang.String, int)public void setOnlyBuffering(boolean value)
This must be done before the first output is written. Buffering is needed to process elements that can not be written directly to the output stream because their sub - elements have to be processed seperatly. Which is so far true only for JSP pages.
If buffering is on, nothing is written to the output stream even if streaming for this resonse is enabled.
value - the value to set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||