public abstract class Response extends HttpOperation
ResponseContentInterceptor and
ResponseStreamWrapper instances to the curent HttpServletResponse| Constructor and Description |
|---|
Response() |
| Modifier and Type | Method and Description |
|---|---|
static Response |
addCookie(Cookie cookie)
|
static Response |
addDateHeader(String name,
long value)
Create an
Operation that adds a date header to the HttpServletResponse |
static Response |
addHeader(String name,
String value)
Create an
Operation that adds a header to the HttpServletResponse |
static Response |
addIntHeader(String name,
int value)
|
static Response |
setCode(int code)
Create an
Operation that sets the HttpServletResponse.setStatus(int) code of the current
HttpServletResponse. |
static Response |
withOutputInterceptedBy(ResponseContentInterceptor... buffers)
Create an
Operation that adds the given ResponseContentInterceptor instances to the current
ServletResponse. |
static Response |
withOutputStreamWrappedBy(ResponseStreamWrapper... wrappers)
Create an
Operation that adds the given ResponseStreamWrapper instances to the current
ServletResponse. |
static Response |
write(byte... bytes)
Create an
Operation that writes the given bytes to the current HttpServletResponse upon execution. |
static Response |
write(InputStream stream)
Create an
Operation that writes the contents of the given InputStream current
HttpServletResponse upon execution. |
static Response |
write(Object value)
Create an
Operation that writes the String value of the given Object to the current
HttpServletResponse upon execution. |
perform, performHttpandpublic static Response 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 Response 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 Response addHeader(String name, String value)
Operation that adds a header to the HttpServletResponsepublic static Response addDateHeader(String name, long value)
Operation that adds a date header to the HttpServletResponsepublic static Response setCode(int code)
Operation that sets the HttpServletResponse.setStatus(int) code of the current
HttpServletResponse.public static Response write(byte... bytes)
Operation that writes the given bytes to the current HttpServletResponse upon execution.public static Response 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 Response write(InputStream stream)
Operation that writes the contents of the given InputStream current
HttpServletResponse upon execution.Copyright © 2013 OCPsoft. All Rights Reserved.