public class ServletServiceResponse extends ServiceResponse
ServiceResponse implemented over native
Servlet response.| Modifier and Type | Field and Description |
|---|---|
protected StatsCollectingOutputStream |
_output |
protected javax.servlet.http.HttpServletResponse |
_response
Underlying response object exposed by Servlet API.
|
protected long |
_responseLength |
protected int |
_statusCode
Since 'getStatus()' was only added in Servlet 3.0, let's actually
keep track of it here.
|
_entity, _streamingContent| Constructor and Description |
|---|
ServletServiceResponse(javax.servlet.http.HttpServletResponse r) |
| Modifier and Type | Method and Description |
|---|---|
ServletServiceResponse |
addHeader(String key,
int value) |
ServletServiceResponse |
addHeader(String key,
long value) |
ServletServiceResponse |
addHeader(String key,
String value) |
long |
getBytesWritten() |
int |
getStatus() |
ServletServiceResponse |
set(int code,
Object entity) |
ServletServiceResponse |
setContentLength(long length) |
ServletServiceResponse |
setContentType(String contentType) |
ServletServiceResponse |
setStatus(int code) |
void |
writeOut(com.fasterxml.jackson.databind.ObjectWriter writer) |
void |
writeRaw(byte[] raw) |
void |
writeText(String msg) |
accepted, badMethod, badRange, badRequest, conflict, getEntity, gone, hasEntity, hasStreamingContent, internalError, internalFileNotFound, internalServerError, internalServerError, isError, noContent, notChanged, notFound, notFound, ok, ok, ok, partialContent, serverOverload, serviceTimeout, setBodyCompression, setContentTypeJson, setContentTypeText, setEntityprotected final javax.servlet.http.HttpServletResponse _response
protected int _statusCode
protected long _responseLength
protected StatsCollectingOutputStream _output
public ServletServiceResponse(javax.servlet.http.HttpServletResponse r)
public void writeOut(com.fasterxml.jackson.databind.ObjectWriter writer)
throws IOException
IOExceptionpublic void writeText(String msg) throws IOException
IOExceptionpublic void writeRaw(byte[] raw)
throws IOException
IOExceptionpublic long getBytesWritten()
getBytesWritten in class ServiceResponsepublic int getStatus()
getStatus in class ServiceResponsepublic ServletServiceResponse set(int code, Object entity)
set in class ServiceResponsepublic ServletServiceResponse setStatus(int code)
setStatus in class ServiceResponsepublic ServletServiceResponse setContentType(String contentType)
setContentType in class ServiceResponsepublic ServletServiceResponse setContentLength(long length)
setContentLength in class ServiceResponsepublic ServletServiceResponse addHeader(String key, String value)
addHeader in class ServiceResponsepublic ServletServiceResponse addHeader(String key, int value)
addHeader in class ServiceResponsepublic ServletServiceResponse addHeader(String key, long value)
addHeader in class ServiceResponseCopyright © 2012-2014 fasterxml.com. All Rights Reserved.