|
|
|
@ -218,7 +218,6 @@ public class DefaultHandlerExceptionResolver extends AbstractHandlerExceptionRes |
|
|
|
protected ModelAndView handleHttpRequestMethodNotSupported(HttpRequestMethodNotSupportedException ex, |
|
|
|
protected ModelAndView handleHttpRequestMethodNotSupported(HttpRequestMethodNotSupportedException ex, |
|
|
|
HttpServletRequest request, HttpServletResponse response, Object handler) throws IOException { |
|
|
|
HttpServletRequest request, HttpServletResponse response, Object handler) throws IOException { |
|
|
|
|
|
|
|
|
|
|
|
pageNotFoundLogger.warn(ex.getMessage()); |
|
|
|
|
|
|
|
String[] supportedMethods = ex.getSupportedMethods(); |
|
|
|
String[] supportedMethods = ex.getSupportedMethods(); |
|
|
|
if (supportedMethods != null) { |
|
|
|
if (supportedMethods != null) { |
|
|
|
response.setHeader("Allow", StringUtils.arrayToDelimitedString(supportedMethods, ", ")); |
|
|
|
response.setHeader("Allow", StringUtils.arrayToDelimitedString(supportedMethods, ", ")); |
|
|
|
@ -342,9 +341,6 @@ public class DefaultHandlerExceptionResolver extends AbstractHandlerExceptionRes |
|
|
|
protected ModelAndView handleConversionNotSupported(ConversionNotSupportedException ex, |
|
|
|
protected ModelAndView handleConversionNotSupported(ConversionNotSupportedException ex, |
|
|
|
HttpServletRequest request, HttpServletResponse response, Object handler) throws IOException { |
|
|
|
HttpServletRequest request, HttpServletResponse response, Object handler) throws IOException { |
|
|
|
|
|
|
|
|
|
|
|
if (logger.isWarnEnabled()) { |
|
|
|
|
|
|
|
logger.warn("Failed to convert request element: " + ex); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
sendServerError(ex, request, response); |
|
|
|
sendServerError(ex, request, response); |
|
|
|
return new ModelAndView(); |
|
|
|
return new ModelAndView(); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -363,9 +359,6 @@ public class DefaultHandlerExceptionResolver extends AbstractHandlerExceptionRes |
|
|
|
protected ModelAndView handleTypeMismatch(TypeMismatchException ex, |
|
|
|
protected ModelAndView handleTypeMismatch(TypeMismatchException ex, |
|
|
|
HttpServletRequest request, HttpServletResponse response, Object handler) throws IOException { |
|
|
|
HttpServletRequest request, HttpServletResponse response, Object handler) throws IOException { |
|
|
|
|
|
|
|
|
|
|
|
if (logger.isWarnEnabled()) { |
|
|
|
|
|
|
|
logger.warn("Failed to bind request element: " + ex); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
response.sendError(HttpServletResponse.SC_BAD_REQUEST); |
|
|
|
response.sendError(HttpServletResponse.SC_BAD_REQUEST); |
|
|
|
return new ModelAndView(); |
|
|
|
return new ModelAndView(); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -386,9 +379,6 @@ public class DefaultHandlerExceptionResolver extends AbstractHandlerExceptionRes |
|
|
|
protected ModelAndView handleHttpMessageNotReadable(HttpMessageNotReadableException ex, |
|
|
|
protected ModelAndView handleHttpMessageNotReadable(HttpMessageNotReadableException ex, |
|
|
|
HttpServletRequest request, HttpServletResponse response, Object handler) throws IOException { |
|
|
|
HttpServletRequest request, HttpServletResponse response, Object handler) throws IOException { |
|
|
|
|
|
|
|
|
|
|
|
if (logger.isWarnEnabled()) { |
|
|
|
|
|
|
|
logger.warn("Failed to read HTTP message: " + ex); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
response.sendError(HttpServletResponse.SC_BAD_REQUEST); |
|
|
|
response.sendError(HttpServletResponse.SC_BAD_REQUEST); |
|
|
|
return new ModelAndView(); |
|
|
|
return new ModelAndView(); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -410,9 +400,6 @@ public class DefaultHandlerExceptionResolver extends AbstractHandlerExceptionRes |
|
|
|
protected ModelAndView handleHttpMessageNotWritable(HttpMessageNotWritableException ex, |
|
|
|
protected ModelAndView handleHttpMessageNotWritable(HttpMessageNotWritableException ex, |
|
|
|
HttpServletRequest request, HttpServletResponse response, Object handler) throws IOException { |
|
|
|
HttpServletRequest request, HttpServletResponse response, Object handler) throws IOException { |
|
|
|
|
|
|
|
|
|
|
|
if (logger.isWarnEnabled()) { |
|
|
|
|
|
|
|
logger.warn("Failed to write HTTP message: " + ex); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
sendServerError(ex, request, response); |
|
|
|
sendServerError(ex, request, response); |
|
|
|
return new ModelAndView(); |
|
|
|
return new ModelAndView(); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -508,8 +495,8 @@ public class DefaultHandlerExceptionResolver extends AbstractHandlerExceptionRes |
|
|
|
if (!response.isCommitted()) { |
|
|
|
if (!response.isCommitted()) { |
|
|
|
response.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE); |
|
|
|
response.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE); |
|
|
|
} |
|
|
|
} |
|
|
|
else if (logger.isDebugEnabled()) { |
|
|
|
else { |
|
|
|
logger.debug("Async timeout for " + request.getMethod() + " [" + request.getRequestURI() + "]"); |
|
|
|
logger.warn("Async request timed out"); |
|
|
|
} |
|
|
|
} |
|
|
|
return new ModelAndView(); |
|
|
|
return new ModelAndView(); |
|
|
|
} |
|
|
|
} |
|
|
|
|