@ExceptionHandler methods should support naked beans as return values [SPR-6693] #11359
Labels
has: votes-jira
Issues migrated from JIRA with more than 10 votes at the time of import
in: web
Issues in web modules (web, webmvc, webflux, websocket)
type: enhancement
A general enhancement
Milestone
Scott Frederick opened SPR-6693 and commented
Spring MVC
@ExceptionHandler
controller methods support a flexible argument list and return value, similiar to@RequestMapping-annotated
methods. One option that is supported by@RequestMapping
methods but not@ExceptionHandler
methods is returning naked bean objects from the exception handler method.For example, this type of exception handler method would be very convenient, especially when building RESTful services using a MarshallingView (the important detail is the "HelloResponse" return value from the handleBindException method):
With a response object that looks like this:
Currently this code will throw an exception when the exception handler method returns to the framework:
Affects: 3.0 GA
Attachments:
13 votes, 19 watchers
The text was updated successfully, but these errors were encountered: