jakarta.servlet.http.HttpServletResponse that transforms an application response object
(which might be the original one passed to a servlet.
| Modifier and Type | Field and Description |
|---|---|
| private boolean | included
Is this wrapped response the subject of an |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addCookie(Cookie cookie)
Overrides jakarta. Implements jakarta. The default behavior of this method is to call addCookie(Cookie cookie) on the wrapped response object. |
| public void | addDateHeader(String name, long date)
Overrides jakarta. Implements jakarta. The default behavior of this method is to call addDateHeader(String name, long date) on the wrapped response object. |
| public void | addHeader(String name, String value)
Overrides jakarta. Implements jakarta. The default behavior of this method is to return addHeader(String name, String value) on the wrapped response object. |
| public void | addIntHeader(String name, int value)
Overrides jakarta. Implements jakarta. The default behavior of this method is to call addIntHeader(String name, int value) on the wrapped response object. |
| public void | reset()
Overrides jakarta. Implements jakarta. Clears any data that exists in the buffer as well as the status code, headers. |
| public void | sendError(int sc, String msg)
Overrides jakarta. Implements jakarta. The default behavior of this method is to call sendError(int sc, String msg) on the wrapped response object. |
| public void | sendError(int sc)
Overrides jakarta. Implements jakarta. The default behavior of this method is to call sendError(int sc) on the wrapped response object. |
| public void | sendRedirect(String location)
Overrides jakarta. Overrides default jakarta. The default behavior of this method is to return sendRedirect(String location) on the wrapped response object. |
| public void | setBufferSize(int size)
Overrides jakarta. Implements jakarta. Sets the preferred buffer size for the body of the response. |
| public void | setCharacterEncoding(String charEnc)
Overrides jakarta. Implements jakarta. Sets the character encoding (MIME charset) of the response being sent to the client, for example, to UTF-8. |
| public void | setContentLength(int len)
Overrides jakarta. 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 type)
Overrides jakarta. Implements jakarta. Sets the content type of the response being sent to the client, if the response has not been committed yet. |
| public void | setDateHeader(String name, long date)
Overrides jakarta. Implements jakarta. The default behavior of this method is to call setDateHeader(String name, long date) on the wrapped response object. |
| public void | setHeader(String name, String value)
Overrides jakarta. Implements jakarta. The default behavior of this method is to return setHeader(String name, String value) on the wrapped response object. |
| public void | setIntHeader(String name, int value)
Overrides jakarta. Implements jakarta. The default behavior of this method is to call setIntHeader(String name, int value) on the wrapped response object. |
| public void | setLocale(Locale loc)
Overrides jakarta. Implements jakarta. Sets the locale of the response, if the response has not been committed yet. |
| private void | setResponse(HttpServletResponse
The new wrapped response response)Set the response that we are wrapping. |
| public void | setStatus(int sc)
Overrides jakarta. Implements jakarta. The default behavior of this method is to call setStatus(int sc) on the wrapped response object. |
| included | back to summary |
|---|---|
| private boolean included Is this wrapped response the subject of an | |
| DispatchedHttpServletResponse | back to summary |
|---|---|
| public DispatchedHttpServletResponse(HttpServletResponse response, boolean included) | |
| addCookie | back to summary |
|---|---|
| public void addCookie(Cookie cookie) Overrides jakarta. Implements jakarta. Doc from jakarta. The default behavior of this method is to call addCookie(Cookie cookie) on the wrapped response object.
| |
| addDateHeader | back to summary |
|---|---|
| public void addDateHeader(String name, long date) Overrides jakarta. Implements jakarta. Doc from jakarta. The default behavior of this method is to call addDateHeader(String name, long date) on the wrapped response object.
| |
| addHeader | back to summary |
|---|---|
| public void addHeader(String name, String value) Overrides jakarta. Implements jakarta. Doc from jakarta. The default behavior of this method is to return addHeader(String name, String value) on the wrapped response object.
| |
| addIntHeader | back to summary |
|---|---|
| public void addIntHeader(String name, int value) Overrides jakarta. Implements jakarta. Doc from jakarta. The default behavior of this method is to call addIntHeader(String name, int value) on the wrapped response object.
| |
| reset | back to summary |
|---|---|
| public void reset() Overrides jakarta. Implements jakarta. Doc from jakarta. Clears any data that exists in the buffer as well as the status code, headers. The state of calling
| |
| sendError | back to summary |
|---|---|
| public void sendError(int sc, String msg) throws IOException Overrides jakarta. Implements jakarta. Doc from jakarta. The default behavior of this method is to call sendError(int sc, String msg) on the wrapped response object.
| |
| sendError | back to summary |
|---|---|
| public void sendError(int sc) throws IOException Overrides jakarta. Implements jakarta. Doc from jakarta. The default behavior of this method is to call sendError(int sc) on the wrapped response object.
| |
| sendRedirect | back to summary |
|---|---|
| public void sendRedirect(String location) throws IOException Overrides jakarta. Overrides default jakarta. Doc from jakarta. The default behavior of this method is to return sendRedirect(String location) on the wrapped response object.
| |
| setBufferSize | back to summary |
|---|---|
| public void setBufferSize(int size) Overrides jakarta. Implements jakarta. Doc from jakarta. Sets the preferred buffer size for the body of the response. The servlet container will use a buffer at least as
large as the size requested. The actual buffer size used can be found using A larger buffer allows more content to be written before anything is actually sent, thus providing the servlet with more time to set appropriate status codes and headers. A smaller buffer decreases server memory load and allows the client to start receiving data more quickly.
This method must be called before any response body content is written; if content has been written or the response
object has been committed, this method throws an
| |
| setCharacterEncoding | back to summary |
|---|---|
| public void setCharacterEncoding(String charEnc) Overrides jakarta. Implements jakarta. Doc from jakarta. Sets the character encoding (MIME charset) of the response being sent to the client, for example, to UTF-8. If the
response character encoding has already been set by
This method can be called repeatedly to change the character encoding. This method has no effect if it is called
after
If calling this method has an effect (as per the previous paragraph), calling this method with
If this method is called with an invalid or unrecognised character encoding, then a subsequent call to
Containers may choose to log calls to this method that use an invalid or unrecognised character encoding.
Containers must communicate the character encoding used for the servlet response's writer to the client if the
protocol provides a way for doing so. In the case of HTTP, the character encoding is communicated as part of the
| |
| setContentLength | back to summary |
|---|---|
| public void setContentLength(int len) Overrides jakarta. Implements jakarta. Doc from jakarta. Sets the length of the content body in the response In HTTP servlets, this method sets the HTTP Content-Length header. This method may be called repeatedly to change the content length. This method has no effect if called after the response has been committed.
| |
| setContentType | back to summary |
|---|---|
| public void setContentType(String type) Overrides jakarta. Implements jakarta. Doc from jakarta. Sets the content type of the response being sent to the client, if the response has not been committed yet. The given
content type may include a character encoding specification, for example,
This method may be called repeatedly to change content type and character encoding. This method has no effect if
called after the response has been committed. It does not set the response's character encoding if it is called after
If calling this method has an effect (as per the previous paragraph), calling this method with
If this method is called with an invalid or unrecognised character encoding, then a subsequent call to
Containers may choose to log calls to this method that use an invalid or unrecognised character encoding.
Containers must communicate the content type and the character encoding used for the servlet response's writer to the
client if the protocol provides a way for doing so. In the case of HTTP, the
| |
| setDateHeader | back to summary |
|---|---|
| public void setDateHeader(String name, long date) Overrides jakarta. Implements jakarta. Doc from jakarta. The default behavior of this method is to call setDateHeader(String name, long date) on the wrapped response object.
| |
| setHeader | back to summary |
|---|---|
| public void setHeader(String name, String value) Overrides jakarta. Implements jakarta. Doc from jakarta. The default behavior of this method is to return setHeader(String name, String value) on the wrapped response object.
| |
| setIntHeader | back to summary |
|---|---|
| public void setIntHeader(String name, int value) Overrides jakarta. Implements jakarta. Doc from jakarta. The default behavior of this method is to call setIntHeader(String name, int value) on the wrapped response object.
| |
| setLocale | back to summary |
|---|---|
| public void setLocale(Locale loc) Overrides jakarta. Implements jakarta. Doc from jakarta. Sets the locale of the response, if the response has not been committed yet. It also sets the response's character
encoding appropriately for the locale, if the character encoding has not been explicitly set using
This method may be called repeatedly to change locale and character encoding. The method has no effect if called
after the response has been committed. It does not set the response's character encoding if it is called after
If calling this method has an effect on the locale (as per the previous paragraph), calling this method with
Containers must communicate the locale and the character encoding used for the servlet response's writer to the
client if the protocol provides a way for doing so. In the case of HTTP, the locale is communicated via the
| |
| setResponse | back to summary |
|---|---|
| private void setResponse(HttpServletResponse response) Set the response that we are wrapping.
| |
| setStatus | back to summary |
|---|---|
| public void setStatus(int sc) Overrides jakarta. Implements jakarta. Doc from jakarta. The default behavior of this method is to call setStatus(int sc) on the wrapped response object.
| |