Browse Source

Minor polish in DispatcherServlet

See gh-23541
pull/23557/head
Rossen Stoyanchev 6 years ago
parent
commit
48233317b8
  1. 3
      spring-webmvc/src/main/java/org/springframework/web/servlet/DispatcherServlet.java
  2. 5
      spring-webmvc/src/main/java/org/springframework/web/servlet/HandlerInterceptor.java

3
spring-webmvc/src/main/java/org/springframework/web/servlet/DispatcherServlet.java

@ -1131,6 +1131,7 @@ public class DispatcherServlet extends FrameworkServlet { @@ -1131,6 +1131,7 @@ public class DispatcherServlet extends FrameworkServlet {
}
if (mappedHandler != null) {
// Exception (if any) is already handled..
mappedHandler.triggerAfterCompletion(request, response, null);
}
}
@ -1316,7 +1317,7 @@ public class DispatcherServlet extends FrameworkServlet { @@ -1316,7 +1317,7 @@ public class DispatcherServlet extends FrameworkServlet {
if (logger.isTraceEnabled()) {
logger.trace("Using resolved error view: " + exMv, ex);
}
if (logger.isDebugEnabled()) {
else if (logger.isDebugEnabled()) {
logger.debug("Using resolved error view: " + exMv);
}
WebUtils.exposeErrorRequestAttributes(request, ex, getServletName());

5
spring-webmvc/src/main/java/org/springframework/web/servlet/HandlerInterceptor.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2019 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.
@ -141,7 +141,8 @@ public interface HandlerInterceptor { @@ -141,7 +141,8 @@ public interface HandlerInterceptor {
* @param response current HTTP response
* @param handler handler (or {@link HandlerMethod}) that started asynchronous
* execution, for type and/or instance examination
* @param ex exception thrown on handler execution, if any
* @param ex any exception thrown on handler execution, if any; this does not
* include exceptions that have been handled through an exception resolver
* @throws Exception in case of errors
*/
default void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler,

Loading…
Cancel
Save