Skip to content

@ResponseBody does not work with @ExceptionHandler [SPR-6902] #11567

@spring-projects-issues

Description

@spring-projects-issues

Florent Ramiere opened SPR-6902 and commented

When this method is executed

@ExceptionHandler
@ResponseBody
public String dummyExceptionHandler(Exception e) {
    return e.getMessage();
}

Spring mvc tries to resolve the view using the method output --> 404.
As the method is annotated with @ResponseBody, it should directly write the method output to the response.


Affects: 3.0.1

Attachments:

Issue Links:

Referenced from: commits 157623b, 7f8c91a

0 votes, 8 watchers

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions