| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private static class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| protected boolean | appCommitted
The application commit flag. |
| private HttpServletResponse | |
| private final List | |
| protected Response | coyoteResponse
Coyote response. |
| protected ResponseFacade | facade
The facade associated with this response. |
| protected boolean | included
The included flag. |
| private boolean | isCharacterEncodingSet
The characterEncoding flag |
| private static final Log | |
| private static final MediaTypeCache | |
| protected final OutputBuffer | outputBuffer
The associated output buffer. |
| protected CoyoteOutputStream | outputStream
The associated output stream. |
| protected final CharChunk | redirectURLCC
Recyclable buffer to hold the redirect URL. |
| protected Request | request
The request with which this response is associated. |
| protected static final StringManager | |
| protected final UEncoder | urlEncoder
URL encoder. |
| protected boolean | usingOutputStream
Using output stream flag. |
| protected boolean | usingWriter
Using writer flag. |
| protected CoyoteWriter | writer
The associated writer. |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addCookie(final Cookie
Cookie to be added cookie)Implements jakarta. Add the specified Cookie to those that will be included with this Response. |
| public void | addDateHeader(String
Name of the header to set name, long Date value to be set value)Implements jakarta. Add the specified date header to the specified value. |
| public void | addHeader(String
Name of the header to set name, String Value to be set value)Implements jakarta. Add the specified header to the specified value. |
| private void | |
| public void | addIntHeader(String
Name of the header to set name, int Integer value to be set value)Implements jakarta. Add the specified integer header to the specified value. |
| public void | addSessionCookieInternal(final Cookie
The new session cookie to add the response cookie)Special method for adding a session cookie as we should be overriding any previous. |
| private boolean | Returns: true if the header is special, no need to set the header.An extended version of this exists in |
| public boolean | Returns: true if the header has been setName of the header to check name)Implements jakarta. Has the specified header been set already in this response? |
| private void | |
| private static boolean | |
| public String | Returns: true if the URL was encodedURL to be encoded url)Implements jakarta. Encode the session identifier associated with this response into the specified redirect URL, if necessary. |
| public String | Returns: true if the URL was encodedURL to be encoded url)Implements jakarta. Encode the session identifier associated with this response into the specified URL, if necessary. |
| public void | finishResponse()
Perform whatever actions are required to flush and close the output stream or writer, in a single operation. |
| public void | flushBuffer()
Implements jakarta. Flush the buffer and commit this response. |
| public String | |
| public int | Returns: the actual buffer size used for this Response.Implements jakarta. Returns the actual buffer size used for the response. |
| public long | Returns: the number of bytes the actually written to the socket. This includes chunking, compression, etc. but excludes headers.if flush)true will perform a buffer flush first
|
| public String | Returns: the character encoding used for this Response.Implements jakarta. Returns the name of the character encoding (MIME charset) used for the body sent in this response. |
| public int | |
| public String | Returns: the content type that was set or calculated for this response, ornull if no content type
was set.Implements jakarta. Returns the content type used for the MIME body sent in this response. |
| public long | Returns: the number of bytes the application has actually written to the output stream. This excludes chunking, compression, etc. as well as headers.
|
| public Context | |
| public List | |
| public Response | |
| public String | getHeader(String
Header name to look up name)Implements jakarta. Return the value for the specified header, or |
| public Collection | getHeaderNames()
Implements jakarta. Get the header names set for this HTTP response. |
| public Collection | getHeaders(String
Header name to look up name)Implements jakarta. Return a Collection of all the header values associated with the specified header name. |
| public Locale | Returns: the Locale assigned to this response.Implements jakarta. Returns the locale specified for this response using the |
| public String | |
| public ServletOutputStream | Returns: the servlet output stream associated with this Response.Implements jakarta. Returns a |
| public PrintWriter | Returns: Writer which can be used for error reports. If the response is not an error report returned using sendError or triggered by an unexpected exception thrown during the servlet processing (and only in that case), null will be returned if the response stream has already been used.Return a PrintWriter that can be used to render error messages, regardless of whether a stream or writer has already been acquired. |
| public Request | |
| public HttpServletResponse | |
| public int | getStatus()
Implements jakarta. Get the HTTP status code for this Response. |
| public Supplier | getTrailerFields()
Overrides default jakarta. Obtain the supplier of the trailer headers. |
| public PrintWriter | Returns: the writer associated with this Response.Implements jakarta. Returns a |
| private boolean | |
| public boolean | Returns: true if the application has committed the responseApplication commit flag accessor. |
| public boolean | |
| public boolean | Returns: true if the response has been committedImplements jakarta. Has the output of this response already been committed? |
| protected boolean | Returns: true if the URL should be encodedAbsolute URL to be validated location)Return |
| public boolean | |
| public boolean | |
| public boolean | |
| private void | |
| public void | recycle()
Release all object references, and initialize instance variables, in preparation for reuse of this object. |
| public void | |
| public void | resetBuffer()
Implements jakarta. Reset the data buffer but not any status or header information. |
| public void | resetBuffer(boolean
true if the internal usingWriter,
usingOutputStream, isCharacterEncodingSet flags
should also be resetReset the data buffer and the using Writer/Stream flags but not any status or header information. |
| public void | sendAcknowledgement(ContinueResponseTiming
Indicates when the request for the ACK originated so it can be compared with the
configured timing for ACK responses. continueResponseTiming)Send an acknowledgement of a request. |
| public void | sendError(int
HTTP status code to send status)Implements jakarta. Send an error response with the specified status and a default message. |
| public void | sendError(int
HTTP status code to send status, String Corresponding message to send message)Implements jakarta. Send an error response with the specified status and message. |
| public void | sendRedirect(String
the redirect location URL (may be absolute or relative) location)Implements jakarta. Sends a redirect response to the client using the specified redirect location URL with the status code
|
| public void | sendRedirect(String
Location URL to redirect to location, int HTTP status code that will be sent status)Internal method that allows a redirect to be sent with a status other than |
| public void | setAppCommitted(boolean
The new application committed flag value appCommitted)Set the application commit flag. |
| public void | setBufferSize(int
The new buffer size size)Implements jakarta. Set the buffer size to be used for this Response. |
| public void | setCharacterEncoding(String
String containing the name of the character encoding. encoding)Implements jakarta. Overrides the name of the character encoding used in the body of the request. |
| public void | setContentLength(int
The new content length length)Implements jakarta. Set the content length (in bytes) for this Response. |
| public void | setContentLengthLong(long
an integer specifying the length of the content being returned to the client; sets the
Content-Length header length)Implements jakarta. Sets the length of the content body in the response In HTTP servlets, this method sets the HTTP Content-Length header. |
| public void | setContentType(String
The new content type type)Implements jakarta. Set the content type for this Response. |
| public void | |
| public void | setDateHeader(String
Name of the header to set name, long Date value to be set value)Implements jakarta. Set the specified date header to the specified value. |
| public boolean | Returns: false if the error flag was already set
Deprecated
This method will be changed to return void in Tomcat 11 onwards
Set the error flag. |
| public boolean | |
| public void | setHeader(String
Name of the header to set name, String Value to be set value)Implements jakarta. Set the specified header to the specified value. |
| public void | setIntHeader(String
Name of the header to set name, int Integer value to be set value)Implements jakarta. Set the specified integer header to the specified value. |
| public void | setLocale(Locale
The new locale locale)Implements jakarta. Set the Locale that is appropriate for this response, including setting the appropriate character encoding. |
| public void | setRequest(Request
The new associated request request)Set the Request with which this Response is associated. |
| public void | setResponse(HttpServletResponse
The wrapped response to pass to the application applicationResponse)Set a wrapped HttpServletResponse to pass to the application. |
| public void | setStatus(int
The new HTTP status status)Implements jakarta. Set the HTTP status to be returned with this response. |
| public void | |
| public void | setTrailerFields(Supplier<Map<String, String>>
The supplier for the trailer headers supplier)Overrides default jakarta. Configure the supplier of the trailer headers. |
| protected String | Returns: the encoded URLURL to be (possibly) converted and then returned location)Convert (if necessary) and return the absolute URL that represents the resource referenced by this possibly relative URL. |
| protected String |