Dave Syer opened SPR-8839 and commented
@ExceptionHandler
should be able to return ResponseEntity, for consistency with @RequestMapping
, and to enable custom (dynamic) status codes to be added to the response (@ResponseStatus
has to be hardcoded). It's pretty easy to do this - you just add a handler for ResponseEntity to the AnnotationMethodExceptionHandlerResolver.
Affects: 3.0.6