Produces media types cleared prior to error handling

Issue: SPR-16318
This commit is contained in:
Rossen Stoyanchev
2018-05-14 14:41:19 -04:00
parent b3b233b43a
commit 395792b302
4 changed files with 77 additions and 6 deletions

View File

@@ -1248,6 +1248,9 @@ public class DispatcherServlet extends FrameworkServlet {
protected ModelAndView processHandlerException(HttpServletRequest request, HttpServletResponse response,
@Nullable Object handler, Exception ex) throws Exception {
// Success and error responses may use different content types
request.removeAttribute(HandlerMapping.PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE);
// Check registered HandlerExceptionResolvers...
ModelAndView exMv = null;
if (this.handlerExceptionResolvers != null) {