Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Log warning if ResponseStatus 'reason' is set and handler returns value
When a handler method is annotated with `@ResponseStatus(reason="...")`, Spring MVC will use `HttpServletResponse#sendError` to complete the response. As a result, the Servlet container will send an HTML error page and any existing data in the response buffer will be cleared. This commit clarifies the `@ResponseStatus` Javadoc and ensures that a message is logged at the WARN level if a handler method is annotated like this and still returns a non-Void value. In this case, the return value will be ignored and developers should be aware of this fact. See gh-31113 Closes gh-31121
- Loading branch information