public class JsonResponder extends AbstractRestResponder
Responder that is able to return JSON responses.
This implementation uses Jackson for JSON support.| Modifier and Type | Field and Description |
|---|---|
private org.codehaus.jackson.map.ObjectMapper |
mapper |
| Constructor and Description |
|---|
JsonResponder() |
| Modifier and Type | Method and Description |
|---|---|
private void |
writeJsonResponse(Object entity,
RouteContext routeContext) |
void |
writeResponse(Object entity,
RouteContext routeContext)
Writes the passed-in entity to the
HttpServletResponse enabling concrete implementation
to add additional headers of in other ways process the response. |
accepts, mediaType, respondpublic void writeResponse(Object entity, RouteContext routeContext) throws Exception
AbstractRestResponderHttpServletResponse enabling concrete implementation
to add additional headers of in other ways process the response.writeResponse in class AbstractRestResponderentity - the entity returned from a Route endpoint.routeContext - the current RouteContext.Exception - if an error occurs while responding.private void writeJsonResponse(Object entity, RouteContext routeContext) throws Exception
ExceptionCopyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.