Ideally, we'd like to be able to output either JSON or XML, depending on what format the client has asked for (via the Accept header). Download High Performance Java Persistence PDF. The downside is, as mentioned before, no control over the body of the response. Persistence VLAD MIHALCEA - Java Persistence and Hibernate Tips that can boost up your application. The combination of DefaultHandlerExceptionResolver and ResponseStatusExceptionResolver goes a long way toward providing a good error handling mechanism for a Spring RESTful Service.