mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
94a49c4ed3
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