public abstract class Response extends HttpOperation
ResponseContentInterceptor and
ResponseStreamWrapper instances to the current HttpServletResponse| Constructor and Description |
|---|
Response() |
| Modifier and Type | Method and Description |
|---|---|
static OperationBuilder |
addCookie(Cookie cookie)
|
static OperationBuilder |
addDateHeader(String name,
long value)
Create an
Operation that adds a date header to the HttpServletResponse |
static OperationBuilder |
addHeader(String name,
String value)
Create an
Operation that adds a header to the HttpServletResponse |
static OperationBuilder |
addIntHeader(String name,
int value)
|
static OperationBuilder |
complete()
Create an
Operation that halts further Rewrite processing and completes the current
HttpServletResponse. |
static OperationBuilder |
gzipCompression()
Compress the
ServletOutputStream contents written to the client. |
static OperationBuilder |
gzipStreamCompression()
Compress the
ServletOutputStream contents written to the client. |
static ConditionBuilder |
isCommitted()
Create a
Condition that evaluates the status of ServletResponse.isCommitted(). |
static OperationBuilder |
setContentType(String contentType)
Create an
Operation that sets the content type for the HttpServletResponse |
static OperationBuilder |
setStatus(int status)
Create an
Operation that sets the given status code via HttpServletResponse.setStatus(int). |
static OperationBuilder |
withOutputInterceptedBy(ResponseContentInterceptor... buffers)
Create an
Operation that adds the given ResponseContentInterceptor instances to the current
ServletResponse. |
static OperationBuilder |
withOutputStreamWrappedBy(ResponseStreamWrapper... wrappers)
Create an
Operation that adds the given ResponseStreamWrapper instances to the current
ServletResponse. |
static OperationBuilder |
write(byte... bytes)
Create an
Operation that writes the given bytes to the current HttpServletResponse upon execution. |
static OperationBuilder |
write(InputStream stream)
Create an
Operation that writes the contents of the given InputStream current
HttpServletResponse upon execution. |
static OperationBuilder |
write(Object value)
Create an
Operation that writes the String value of the given Object to the current
HttpServletResponse upon execution. |
perform, performHttpandpublic static OperationBuilder withOutputInterceptedBy(ResponseContentInterceptor... buffers) throws IllegalStateException
Operation that adds the given ResponseContentInterceptor instances to the current
ServletResponse. This will activate response buffering on the current ServletRequest - meaning
that generated output will not be sent to the client until the entire request has completed and all registered
ResponseContentInterceptor instances have been executed on the outbound response content.
WARNING: This will cause the ENTIRE response to be buffered in memory, which may cause performance
issues on larger responses. Make sure you you really need to buffer the entire response! Favor using a
ResponseStreamWrapper if desired behavior may be performed as a stream operation; this will result in far
less memory overhead.
IllegalStateException - When output has already been written to the client.public static OperationBuilder withOutputStreamWrappedBy(ResponseStreamWrapper... wrappers) throws IllegalStateException
Operation that adds the given ResponseStreamWrapper instances to the current
ServletResponse. This will activate response stream wrapping on the current ServletRequest -
meaning response content will be piped through all registered ResponseStreamWrapper instances as it is
written to the client ServletOutputStream.IllegalStateException - When output has already been written to the client.public static OperationBuilder addHeader(String name, String value)
Operation that adds a header to the HttpServletResponsepublic static OperationBuilder addDateHeader(String name, long value)
Operation that adds a date header to the HttpServletResponsepublic static OperationBuilder setContentType(String contentType)
Operation that sets the content type for the HttpServletResponsepublic static OperationBuilder addIntHeader(String name, int value)
public static OperationBuilder addCookie(Cookie cookie)
public static OperationBuilder gzipCompression()
ServletOutputStream contents written to the client.
WARNING: This causes response content to be buffered in memory in order to properly count the response 'Content-Length'.
public static OperationBuilder gzipStreamCompression()
ServletOutputStream contents written to the client.
WARNING: This means that the HTTP response will not contain a 'Content-Length' header.
public static OperationBuilder write(byte... bytes)
Operation that writes the given bytes to the current HttpServletResponse upon execution.public static OperationBuilder write(Object value)
Operation that writes the String value of the given Object to the current
HttpServletResponse upon execution. The value to be written is obtained using Object.toString().public static OperationBuilder write(InputStream stream)
Operation that writes the contents of the given InputStream current
HttpServletResponse upon execution.public static OperationBuilder setStatus(int status)
Operation that sets the given status code via HttpServletResponse.setStatus(int). This
does not call ServletResponse.flushBuffer()public static OperationBuilder complete()
Operation that halts further Rewrite processing and completes the current
HttpServletResponse.public static ConditionBuilder isCommitted()
Condition that evaluates the status of ServletResponse.isCommitted().Copyright © 2015 OCPsoft. All Rights Reserved.