RESTfu­­l Jav­a­ wit­h ­JAX­-­­RS 2.­0­ (Second Edition)

Chapter 22. Examples for Chapter 7

In Chapter 7, you learned how to create complex responses using the Response and ResponseBuilder classes. You also learned how to map thrown exceptions to a Response using a javax.ws.rs.ext.ExceptionMapper. Since most of our examples use a Response object in one way or another, this chapter focuses only on writing an ExceptionMapper.