| Modifier and Type | Field and Description |
|---|---|
| pack-priv String | |
| pack-priv Charset | |
| pack-priv volatile boolean | committed
Committed flag. |
| private long | |
| pack-priv String | |
| pack-priv long | |
| pack-priv String | contentType
HTTP specific fields. |
| private long | |
| private static final Locale | DEFAULT_LOCALE
Default locale as mandated by the spec. |
| private Exception | errorException
Holds response writing error exception. |
| private final AtomicInteger | errorState
With the introduction of async processing and the possibility of non-container threads calling sendError() tracking the current error state and ensuring that the correct error page is called becomes more complicated. |
| private boolean | |
| pack-priv final MimeHeaders | headers
Response headers. |
| pack-priv volatile ActionHook | hook
Action hook. |
| pack-priv volatile WriteListener | |
| private Locale | |
| private static final Log | |
| pack-priv String | message
Status message. |
| private final Object | |
| pack-priv final Object[] | notes
Notes. |
| pack-priv OutputBuffer | outputBuffer
Associated output buffer. |
| private boolean | |
| pack-priv Request | |
| private static final StringManager | |
| pack-priv int | status
Status code. |
| private Supplier |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public void | |
| public boolean | |
| private boolean | |
| public boolean | Returns: true if the response contains the header.The name of the header of interest name)Does the response contain the given header. |
| public void | |
| public long | Returns: The total number of bytes written to the socket for this responseShould any remaining bytes be flushed before returning the total? If flush)false bytes remaining
in the buffer will not be included in the returned valueBytes written to socket - i.e. after compression, chunking, etc. |
| public String | |
| public Charset | |
| public long | Returns: the time the response was committedReturn the time the response was committed (based on System.currentTimeMillis). |
| public long | Returns: the time the response was committedReturn the time the response was committed (based on System.nanoTime). |
| public String | Returns: The language code for the language currently associated with this responseReturn the content language. |
| public int | |
| public long | |
| public String | |
| public long | Returns: The total number of bytes written to the response by the application. This will not be the number of bytes written to the network which may be more or less than this value.Bytes written by application - i.e. before compression, chunking, etc. |
| public Exception | Returns: The exception that occurredGet the Exception that occurred during the writing of the response. |
| public Locale | |
| public String | |
| public MimeHeaders | |
| public Object | |
| public Request | |
| public int | |
| public Supplier | |
| public WriteListener | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | setCharacterEncoding(String
The name of character encoding. characterEncoding)Overrides the character encoding used in the body of the response. |
| public void | |
| public void | |
| public void | |
| public void | |
| 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 void | setErrorException(Exception
The exception that occurred ex)Set the error Exception that occurred during the writing of the response processing. |
| public boolean | |
| public void | |
| protected void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void |
| characterEncoding | back to summary |
|---|---|
| pack-priv String characterEncoding | |
| charset | back to summary |
|---|---|
| pack-priv Charset charset | |
| committed | back to summary |
|---|---|
| pack-priv volatile boolean committed Committed flag. | |
| commitTimeNanos | back to summary |
|---|---|
| private long commitTimeNanos | |
| contentLanguage | back to summary |
|---|---|
| pack-priv String contentLanguage | |
| contentLength | back to summary |
|---|---|
| pack-priv long contentLength | |
| contentType | back to summary |
|---|---|
| pack-priv String contentType HTTP specific fields. | |
| contentWritten | back to summary |
|---|---|
| private long contentWritten | |
| DEFAULT_LOCALE | back to summary |
|---|---|
| private static final Locale DEFAULT_LOCALE Default locale as mandated by the spec. | |
| errorException | back to summary |
|---|---|
| private Exception errorException Holds response writing error exception. | |
| errorState | back to summary |
|---|---|
| private final AtomicInteger errorState With the introduction of async processing and the possibility of non-container threads calling sendError() tracking the current error state and ensuring that the correct error page is called becomes more complicated. This state attribute helps by tracking the current error state and informing callers that attempt to change state if the change was successful or if another thread got there first. The state machine is very simple: 0 - NONE 1 - NOT_REPORTED 2 - REPORTED -->---->-- >NONE | | | | | | setError() ^ ^ | | | \|/ | |-<-NOT_REPORTED | | ^ | report() | | | \|/ |----<----REPORTED | |
| fireListener | back to summary |
|---|---|
| private boolean fireListener | |
| headers | back to summary |
|---|---|
| pack-priv final MimeHeaders headers Response headers. | |
| hook | back to summary |
|---|---|
| pack-priv volatile ActionHook hook Action hook. | |
| listener | back to summary |
|---|---|
| pack-priv volatile WriteListener listener | |
| locale | back to summary |
|---|---|
| private Locale locale | |
| log | back to summary |
|---|---|
| private static final Log log | |
| message | back to summary |
|---|---|
| pack-priv String message Status message. | |
| nonBlockingStateLock | back to summary |
|---|---|
| private final Object nonBlockingStateLock | |
| notes | back to summary |
|---|---|
| pack-priv final Object[] notes Notes. | |
| outputBuffer | back to summary |
|---|---|
| pack-priv OutputBuffer outputBuffer Associated output buffer. | |
| registeredForWrite | back to summary |
|---|---|
| private boolean registeredForWrite | |
| req | back to summary |
|---|---|
| pack-priv Request req | |
| sm | back to summary |
|---|---|
| private static final StringManager sm | |
| status | back to summary |
|---|---|
| pack-priv int status Status code. | |
| trailerFieldsSupplier | back to summary |
|---|---|
| private Supplier<Map<String, String>> trailerFieldsSupplier | |
| Response | back to summary |
|---|---|
| public Response() | |
| action | back to summary |
|---|---|
| public void action(ActionCode actionCode, Object param) | |
| addHeader | back to summary |
|---|---|
| public void addHeader(String name, String value) | |
| addHeader | back to summary |
|---|---|
| public void addHeader(String name, String value, Charset charset) | |
| checkRegisterForWrite | back to summary |
|---|---|
| public boolean checkRegisterForWrite() | |
| checkSpecialHeader | back to summary |
|---|---|
| private boolean checkSpecialHeader(String name, String value) Set internal fields for special header names. Called from set/addHeader. Return true if the header is special, no need to set the header. | |
| containsHeader | back to summary |
|---|---|
| public boolean containsHeader(String name) Does the response contain the given header. Warning This method always returns
| |
| doWrite | back to summary |
|---|---|
| public void doWrite(ByteBuffer chunk) throws IOException Write a chunk of bytes.
| |
| getBytesWritten | back to summary |
|---|---|
| public long getBytesWritten(boolean flush) Bytes written to socket - i.e. after compression, chunking, etc.
| |
| getCharacterEncoding | back to summary |
|---|---|
public String getCharacterEncoding()
| |
| getCharset | back to summary |
|---|---|
| public Charset getCharset() | |
| getCommitTime | back to summary |
|---|---|
| public long getCommitTime() Return the time the response was committed (based on System.currentTimeMillis).
| |
| getCommitTimeNanos | back to summary |
|---|---|
| public long getCommitTimeNanos() Return the time the response was committed (based on System.nanoTime).
| |
| getContentLanguage | back to summary |
|---|---|
| public String getContentLanguage() Return the content language.
| |
| getContentLength | back to summary |
|---|---|
| public int getContentLength() | |
| getContentLengthLong | back to summary |
|---|---|
| public long getContentLengthLong() | |
| getContentType | back to summary |
|---|---|
| public String getContentType() | |
| getContentWritten | back to summary |
|---|---|
| public long getContentWritten() Bytes written by application - i.e. before compression, chunking, etc.
| |
| getErrorException | back to summary |
|---|---|
| public Exception getErrorException() Get the Exception that occurred during the writing of the response.
| |
| getLocale | back to summary |
|---|---|
| public Locale getLocale() | |
| getMessage | back to summary |
|---|---|
| public String getMessage() Get the status message.
| |
| getMimeHeaders | back to summary |
|---|---|
| public MimeHeaders getMimeHeaders() | |
| getNote | back to summary |
|---|---|
| public Object getNote(int pos) | |
| getRequest | back to summary |
|---|---|
| public Request getRequest() | |
| getStatus | back to summary |
|---|---|
| public int getStatus() | |
| getTrailerFields | back to summary |
|---|---|
| public Supplier | |
| getWriteListener | back to summary |
|---|---|
| public WriteListener getWriteListener() | |
| isCommitted | back to summary |
|---|---|
| public boolean isCommitted() | |
| isError | back to summary |
|---|---|
| public boolean isError() Error flag accessor.
| |
| isErrorReportRequired | back to summary |
|---|---|
| public boolean isErrorReportRequired() | |
| isExceptionPresent | back to summary |
|---|---|
| public boolean isExceptionPresent() | |
| isReady | back to summary |
|---|---|
| public boolean isReady() | |
| onWritePossible | back to summary |
|---|---|
| public void onWritePossible() throws IOException | |
| recycle | back to summary |
|---|---|
| public void recycle() | |
| reset | back to summary |
|---|---|
| public void reset() throws IllegalStateException | |
| sendHeaders | back to summary |
|---|---|
| public void sendHeaders() Signal that we're done with the headers, and body will follow. Any implementation needs to notify ContextManager, to allow interceptors to fix headers. | |
| setCharacterEncoding | back to summary |
|---|---|
| public void setCharacterEncoding(String characterEncoding) throws UnsupportedEncodingException Overrides the character encoding used in the body of the response. This method must be called prior to writing output using getWriter().
| |
| setCommitted | back to summary |
|---|---|
| public void setCommitted(boolean v) | |
| setContentLength | back to summary |
|---|---|
| public void setContentLength(long contentLength) | |
| setContentType | back to summary |
|---|---|
| public void setContentType(String type) Sets the content type. This method must preserve any response charset that may already have been set via a call to response.setContentType(), response.setLocale(), or response.setCharacterEncoding().
| |
| setContentTypeNoCharset | back to summary |
|---|---|
| public void setContentTypeNoCharset(String type) | |
| setError | back to summary |
|---|---|
| public boolean setError()
Deprecated This method will be changed to return void in Tomcat 11 onwards Set the error flag.
| |
| setErrorException | back to summary |
|---|---|
| public void setErrorException(Exception ex) Set the error Exception that occurred during the writing of the response processing.
| |
| setErrorReported | back to summary |
|---|---|
| public boolean setErrorReported() | |
| setHeader | back to summary |
|---|---|
| public void setHeader(String name, String value) | |
| setHook | back to summary |
|---|---|
| protected void setHook(ActionHook hook) | |
| setLocale | back to summary |
|---|---|
| public void setLocale(Locale locale) Called explicitly by user to set the Content-Language and the default encoding.
| |
| setMessage | back to summary |
|---|---|
| public void setMessage(String message) Set the status message.
| |
| setNote | back to summary |
|---|---|
| public void setNote(int pos, Object value) | |
| setOutputBuffer | back to summary |
|---|---|
| public void setOutputBuffer(OutputBuffer outputBuffer) | |
| setRequest | back to summary |
|---|---|
| public void setRequest(Request req) | |
| setStatus | back to summary |
|---|---|
| public void setStatus(int status) Set the response status.
| |
| setTrailerFields | back to summary |
|---|---|
| public void setTrailerFields(Supplier<Map<String, String>> supplier) | |
| setWriteListener | back to summary |
|---|---|
| public void setWriteListener(WriteListener listener) | |