|
rewrite-config-servlet 2.0.0.Beta3 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ocpsoft.rewrite.config.DefaultOperationBuilder
org.ocpsoft.rewrite.servlet.config.HttpOperation
org.ocpsoft.rewrite.servlet.config.Response
public abstract class Response
Responsible for manipulating properties such as headers, cookies, ResponseContentInterceptor and
ResponseStreamWrapper instances to the current HttpServletResponse
| Constructor Summary | |
|---|---|
Response()
|
|
| Method Summary | |
|---|---|
static OperationBuilder |
addCookie(Cookie cookie)
Create an Operation that adds a Cookie to the HttpServletResponse |
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)
Create an Operation that adds an int header to the HttpServletResponse |
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 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. |
| Methods inherited from class org.ocpsoft.rewrite.servlet.config.HttpOperation |
|---|
perform, performHttp |
| Methods inherited from class org.ocpsoft.rewrite.config.DefaultOperationBuilder |
|---|
and |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Response()
| Method Detail |
|---|
public 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 HttpServletResponse
public static OperationBuilder addDateHeader(String name,
long value)
Operation that adds a date header to the HttpServletResponse
public static OperationBuilder setContentType(String contentType)
Operation that sets the content type for the HttpServletResponse
public static OperationBuilder addIntHeader(String name,
int value)
Operation that adds an int header to the HttpServletResponse
public static OperationBuilder addCookie(Cookie cookie)
Operation that adds a Cookie to the HttpServletResponse
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.
|
rewrite-config-servlet 2.0.0.Beta3 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||