public interface HttpResponse extends Response
HttpServletResponse
that is to be produced,
based on the processing of a corresponding HttpRequest
.Modifier and Type | Method and Description |
---|---|
void |
addSessionCookieInternal(javax.servlet.http.Cookie cookie)
Special method for adding a session cookie as we should be overriding
any previous
|
String |
getHeader(String name)
Return the value for the specified header, or
null if this
header has not been set. |
Collection<String> |
getHeaderNames() |
Collection<String> |
getHeaders(String name) |
String |
getMessage()
Return the error message that was set with
sendError()
for this Response. |
int |
getStatus()
Return the HTTP status code associated with this Response.
|
void |
reset(int status,
String message)
Reset this response, and specify the values for the HTTP status code
and corresponding message.
|
void |
sendAcknowledgement()
Send an acknowledgment of a request.
|
createOutputStream, encode, finishResponse, getConnector, getContentCount, getContentLength, getContentType, getContext, getDetailMessage, getIncluded, getInfo, getReporter, getRequest, getResponse, getStream, isAppCommitted, isError, isSuspended, recycle, resetBuffer, resetBuffer, setAppCommitted, setConnector, setContext, setDetailMessage, setError, setIncluded, setRequest, setStream, setSuspended
String getHeader(String name)
null
if this
header has not been set. If more than one value was added for this
name, only the first is returned; use getHeaders(String)
to
retrieve all of them.name
- Header name to look upCollection<String> getHeaderNames()
Collection
of the names
of the headers of this responseCollection<String> getHeaders(String name)
name
- the name of the response header whose values to returnCollection
of the values
of the response header with the given namevoid addSessionCookieInternal(javax.servlet.http.Cookie cookie)
cookie
- String getMessage()
sendError()
for this Response.int getStatus()
void reset(int status, String message)
IllegalStateException
- if this response has already been
committedvoid sendAcknowledgement() throws IOException
HTTP/1.1 [STATUS] [REASON-PHRASE].
sendAcknowledgement
in interface Response
IOException
- if an input/output error occursCopyright © 2021. All rights reserved.