public class IncludeResponse extends CauchoResponseWrapper
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
Modifier and Type | Method and Description |
---|---|
void |
addCookie(Cookie cookie)
Sends a new cookie to the client.
|
void |
addDateHeader(java.lang.String name,
long date)
Adds a header by converting a date to a string.
|
void |
addHeader(java.lang.String name,
java.lang.String value)
Adds a header.
|
void |
addIntHeader(java.lang.String name,
int value)
Adds a header by converting an integer value to a string.
|
void |
clearBuffer() |
void |
close() |
boolean |
containsHeader(java.lang.String name)
Returns true if the output headers include
name |
void |
flushBuffer()
Flushes the buffer to the client.
|
void |
flushHeader() |
int |
getBufferSize()
Returns the size of the output buffer.
|
AbstractCacheFilterChain |
getCacheInvocation() |
java.util.Collection<java.lang.String> |
getHeaderNames()
Returns an Iterable for header names set via
HttpServletResponse.setHeader(java.lang.String, java.lang.String) , HttpServletResponse.addHeader(java.lang.String, java.lang.String) , HttpServletResponse.setDateHeader(java.lang.String, long) , HttpServletResponse.addDateHeader(java.lang.String, long) , HttpServletResponse.setIntHeader(java.lang.String, int) , or HttpServletResponse.addIntHeader(java.lang.String, int) , respectively. |
java.util.Collection<java.lang.String> |
getHeaders(java.lang.String name)
Returns an Iterable for header values with a given name
|
java.io.PrintWriter |
getNextWriter()
Returns the parent writer.
|
AbstractResponseStream |
getOriginalStream()
Gets the response stream.
|
ServletOutputStream |
getOutputStream()
Returns the ServletOutputStream for the response.
|
IncludeRequest |
getRequest() |
AbstractResponseStream |
getResponseStream()
Gets the response stream.
|
java.io.PrintWriter |
getWriter()
Returns a PrintWriter for the response.
|
boolean |
isCauchoResponseStream()
Returns true for a Caucho response stream.
|
boolean |
isForwardEnclosed() |
void |
reset()
Resets the output stream, clearing headers and the output buffer.
|
void |
resetBuffer()
Resets the output stream, clearing headers and the output buffer.
|
void |
sendError(int code,
java.lang.String msg)
Sends an HTTP error page based on the status code
|
void |
setBufferSize(int size)
Sets the output buffer size to
size . |
void |
setCacheInvocation(AbstractCacheFilterChain cacheInvocation)
Sets the cache invocation to indicate that the response might be
cacheable.
|
void |
setContentLength(int length)
Explicitly sets the length of the result value.
|
void |
setContentLength(long length) |
void |
setContentType(java.lang.String type)
included response can't set the content type.
|
void |
setDateHeader(java.lang.String name,
long date)
Sets a header by converting a date to a string.
|
void |
setDisableAutoFlush(boolean disable) |
void |
setForwardEnclosed(boolean isForwardEnclosed) |
void |
setHeader(java.lang.String name,
java.lang.String value)
Sets a header.
|
void |
setIntHeader(java.lang.String name,
int value)
Sets a header by converting an integer value to a string.
|
void |
setResponseStream(AbstractResponseStream responseStream)
Sets the ResponseStream
|
void |
setStatus(int code)
Sets the HTTP status
|
void |
setStatus(int code,
java.lang.String msg) |
addFooter, completeCache, encodeRedirectUrl, encodeRedirectURL, encodeUrl, encodeURL, getAbstractHttpResponse, getCauchoResponse, getCharacterEncoding, getCharacterEncodingAssigned, getContentType, getForbidForward, getHeader, getLocale, getResponse, getStatus, getStatusMessage, hasError, isCaching, isCommitted, isNoCacheUnlessVary, killCache, sendError, sendInternalError, sendRedirect, setCharacterEncoding, setFooter, setForbidForward, setHasError, setLocale, setMatchCacheEntry, setNoCache, setPrivateCache, setResponse, setSessionId, toString, writeHeaders
public IncludeRequest getRequest()
getRequest
in class CauchoResponseWrapper
public void setCacheInvocation(AbstractCacheFilterChain cacheInvocation)
setCacheInvocation
in interface CauchoResponse
setCacheInvocation
in class CauchoResponseWrapper
public final AbstractCacheFilterChain getCacheInvocation()
public void close()
close
in interface CauchoResponse
close
in class CauchoResponseWrapper
public void setStatus(int code)
HttpServletResponse
setStatus
in interface HttpServletResponse
setStatus
in class CauchoResponseWrapper
code
- the HTTP status codepublic void setStatus(int code, java.lang.String msg)
setStatus
in interface HttpServletResponse
setStatus
in class CauchoResponseWrapper
public void sendError(int code, java.lang.String msg)
HttpServletResponse
sendError
in interface HttpServletResponse
sendError
in class CauchoResponseWrapper
code
- the HTTP status codepublic void setHeader(java.lang.String name, java.lang.String value)
HttpServletResponse
setHeader
in interface HttpServletResponse
setHeader
in class CauchoResponseWrapper
name
- the header namevalue
- the header valuepublic void addHeader(java.lang.String name, java.lang.String value)
HttpServletResponse
addHeader
in interface HttpServletResponse
addHeader
in class CauchoResponseWrapper
name
- the header namevalue
- the header valuepublic java.util.Collection<java.lang.String> getHeaders(java.lang.String name)
HttpServletResponse
getHeaders
in interface HttpServletResponse
getHeaders
in class CauchoResponseWrapper
public java.util.Collection<java.lang.String> getHeaderNames()
HttpServletResponse
HttpServletResponse.setHeader(java.lang.String, java.lang.String)
, HttpServletResponse.addHeader(java.lang.String, java.lang.String)
, HttpServletResponse.setDateHeader(java.lang.String, long)
, HttpServletResponse.addDateHeader(java.lang.String, long)
, HttpServletResponse.setIntHeader(java.lang.String, int)
, or HttpServletResponse.addIntHeader(java.lang.String, int)
, respectively.getHeaderNames
in interface HttpServletResponse
getHeaderNames
in class CauchoResponseWrapper
public boolean containsHeader(java.lang.String name)
HttpServletResponse
name
containsHeader
in interface HttpServletResponse
containsHeader
in class CauchoResponseWrapper
name
- the header name to testpublic void setDateHeader(java.lang.String name, long date)
HttpServletResponse
To set the page to expire in 15 seconds use the following:
long now = System.currentTime();
response.setDateHeader("Expires", now + 15000);
setDateHeader
in interface HttpServletResponse
setDateHeader
in class CauchoResponseWrapper
name
- name of the headerdate
- the date in milliseconds since the epoch.public void addDateHeader(java.lang.String name, long date)
HttpServletResponse
addDateHeader
in interface HttpServletResponse
addDateHeader
in class CauchoResponseWrapper
name
- name of the headerdate
- the date in milliseconds since the epoch.public void setIntHeader(java.lang.String name, int value)
HttpServletResponse
setIntHeader
in interface HttpServletResponse
setIntHeader
in class CauchoResponseWrapper
name
- name of the headervalue
- the value as an integerpublic void addIntHeader(java.lang.String name, int value)
HttpServletResponse
addIntHeader
in interface HttpServletResponse
addIntHeader
in class CauchoResponseWrapper
name
- name of the headervalue
- the value as an integerpublic void addCookie(Cookie cookie)
HttpServletResponse
addCookie
in interface HttpServletResponse
addCookie
in class CauchoResponseWrapper
public void setContentType(java.lang.String type)
setContentType
in interface ServletResponse
setContentType
in class CauchoResponseWrapper
type
- the mime type of the outputpublic void setContentLength(int length)
ServletResponse
setContentLength
in interface ServletResponse
setContentLength
in class CauchoResponseWrapper
public void setContentLength(long length)
setContentLength
in interface CauchoResponse
setContentLength
in class CauchoResponseWrapper
public void setResponseStream(AbstractResponseStream responseStream)
setResponseStream
in interface CauchoResponse
setResponseStream
in class CauchoResponseWrapper
public AbstractResponseStream getResponseStream()
getResponseStream
in interface CauchoResponse
getResponseStream
in class CauchoResponseWrapper
public AbstractResponseStream getOriginalStream()
public boolean isCauchoResponseStream()
isCauchoResponseStream
in interface CauchoResponse
isCauchoResponseStream
in class CauchoResponseWrapper
public ServletOutputStream getOutputStream() throws java.io.IOException
getOutputStream
in interface ServletResponse
getOutputStream
in class CauchoResponseWrapper
java.io.IOException
public java.io.PrintWriter getWriter() throws java.io.IOException
getWriter
in interface ServletResponse
getWriter
in class CauchoResponseWrapper
java.io.IOException
public java.io.PrintWriter getNextWriter()
public void setBufferSize(int size)
ServletResponse
size
. The servlet engine
may round the size up.setBufferSize
in interface ServletResponse
setBufferSize
in class CauchoResponseWrapper
size
- the new output buffer size.public int getBufferSize()
ServletResponse
getBufferSize
in interface ServletResponse
getBufferSize
in class CauchoResponseWrapper
public void flushBuffer() throws java.io.IOException
ServletResponse
flushBuffer
in interface ServletResponse
flushBuffer
in class CauchoResponseWrapper
java.io.IOException
public void flushHeader() throws java.io.IOException
java.io.IOException
public void setDisableAutoFlush(boolean disable)
public void reset()
ServletResponse
reset()
after data has been committed is illegal.reset
in interface ServletResponse
reset
in class CauchoResponseWrapper
public void resetBuffer()
ServletResponse
reset()
after data has been committed is illegal.resetBuffer
in interface ServletResponse
resetBuffer
in class CauchoResponseWrapper
public void clearBuffer()
public void setForwardEnclosed(boolean isForwardEnclosed)
setForwardEnclosed
in interface CauchoResponse
setForwardEnclosed
in class CauchoResponseWrapper
public boolean isForwardEnclosed()
isForwardEnclosed
in interface CauchoResponse
isForwardEnclosed
in class CauchoResponseWrapper