mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-22 22:19:03 +00:00
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