Prevent response updates if @ResponseStatus has reason

When @ResponseStatus has a reason and servletResponse.sendError() is
called, the response is committed and should no longer be written to.
After this change, the ServletInvocableHandlerMethod will mark the
response fully handled and will ignore any non-null return values.

Issue: SPR-9159
This commit is contained in:
Rossen Stoyanchev
2012-05-11 17:41:14 -04:00
parent 0b17dd2242
commit d52fc3bd2f
4 changed files with 32 additions and 11 deletions

View File

@@ -104,6 +104,10 @@ public class ServletInvocableHandlerMethod extends InvocableHandlerMethod {
return;
}
}
else if (StringUtils.hasText(this.responseReason)) {
mavContainer.setRequestHandled(true);
return;
}
mavContainer.setRequestHandled(false);