diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/HandlerExceptionResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/HandlerExceptionResolver.java index f870fe5a204bca9f4a5dfe1df6139b01d9ec1f48..76ad615e4620d01c285f6744faa51f09035b6f61 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/HandlerExceptionResolver.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/HandlerExceptionResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,8 +46,8 @@ public interface HandlerExceptionResolver { * @param handler the executed handler, or {@code null} if none chosen at the * time of the exception (for example, if multipart resolution failed) * @param ex the exception that got thrown during handler execution - * @return a corresponding {@code ModelAndView} to forward to, or {@code null} - * for default processing + * @return a corresponding {@code ModelAndView} to forward to, + * or {@code null} for default processing in the resolution chain */ @Nullable ModelAndView resolveException( diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractHandlerExceptionResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractHandlerExceptionResolver.java index d60a4a4adcbaea7adb59aec8d7a3746db055eeae..964411c6db4f1fa7d4cc8cd9902a04747c20fb83 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractHandlerExceptionResolver.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractHandlerExceptionResolver.java @@ -17,7 +17,6 @@ package org.springframework.web.servlet.handler; import java.util.Set; - import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -241,10 +240,11 @@ public abstract class AbstractHandlerExceptionResolver implements HandlerExcepti * @param handler the executed handler, or {@code null} if none chosen at the time * of the exception (for example, if multipart resolution failed) * @param ex the exception that got thrown during handler execution - * @return a corresponding {@code ModelAndView} to forward to, or {@code null} for default processing + * @return a corresponding {@code ModelAndView} to forward to, + * or {@code null} for default processing in the resolution chain */ @Nullable - protected abstract ModelAndView doResolveException(HttpServletRequest request, - HttpServletResponse response, @Nullable Object handler, Exception ex); + protected abstract ModelAndView doResolveException( + HttpServletRequest request, HttpServletResponse response, @Nullable Object handler, Exception ex); } diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/SimpleMappingExceptionResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/SimpleMappingExceptionResolver.java index bd2dd435bbab74fa9fd7909df7368e30a5a77e9c..ae09e06d17f65dce6e67e66e9d2d82fe82552e6c 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/SimpleMappingExceptionResolver.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/SimpleMappingExceptionResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -176,12 +176,13 @@ public class SimpleMappingExceptionResolver extends AbstractHandlerExceptionReso * @param handler the executed handler, or {@code null} if none chosen at the time * of the exception (for example, if multipart resolution failed) * @param ex the exception that got thrown during handler execution - * @return a corresponding ModelAndView to forward to, or {@code null} for default processing + * @return a corresponding {@code ModelAndView} to forward to, + * or {@code null} for default processing in the resolution chain */ @Override @Nullable - protected ModelAndView doResolveException(HttpServletRequest request, HttpServletResponse response, - @Nullable Object handler, Exception ex) { + protected ModelAndView doResolveException( + HttpServletRequest request, HttpServletResponse response, @Nullable Object handler, Exception ex) { // Expose ModelAndView for chosen error view. String viewName = determineViewName(ex, request); diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/annotation/ResponseStatusExceptionResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/annotation/ResponseStatusExceptionResolver.java index a064fe856c93fc285911f5eec0cc02413701ab08..542795e61604ebae27ec69106a5944511ed989fe 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/annotation/ResponseStatusExceptionResolver.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/annotation/ResponseStatusExceptionResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -67,8 +67,8 @@ public class ResponseStatusExceptionResolver extends AbstractHandlerExceptionRes @Override @Nullable - protected ModelAndView doResolveException(HttpServletRequest request, HttpServletResponse response, - @Nullable Object handler, Exception ex) { + protected ModelAndView doResolveException( + HttpServletRequest request, HttpServletResponse response, @Nullable Object handler, Exception ex) { try { if (ex instanceof ResponseStatusException) { @@ -86,7 +86,7 @@ public class ResponseStatusExceptionResolver extends AbstractHandlerExceptionRes } } catch (Exception resolveEx) { - logger.warn("Handling of @ResponseStatus resulted in Exception", resolveEx); + logger.warn("ResponseStatus handling resulted in exception", resolveEx); } return null; } diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/support/DefaultHandlerExceptionResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/support/DefaultHandlerExceptionResolver.java index 82798f96cc9028a5738f306fc873f488ab7fb68b..652ddbeb96ab0e864b704564fd4aeb3d3be49117 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/support/DefaultHandlerExceptionResolver.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/support/DefaultHandlerExceptionResolver.java @@ -164,8 +164,8 @@ public class DefaultHandlerExceptionResolver extends AbstractHandlerExceptionRes @Override @Nullable - protected ModelAndView doResolveException(HttpServletRequest request, HttpServletResponse response, - @Nullable Object handler, Exception ex) { + protected ModelAndView doResolveException( + HttpServletRequest request, HttpServletResponse response, @Nullable Object handler, Exception ex) { try { if (ex instanceof HttpRequestMethodNotSupportedException) { @@ -547,7 +547,6 @@ public class DefaultHandlerExceptionResolver extends AbstractHandlerExceptionRes return new ModelAndView(); } - /** * Invoked to send a server error. Sets the status to 500 and also sets the * request attribute "javax.servlet.error.exception" to the Exception.