From 91172f4f430382ea457c72408ba1f371af095826 Mon Sep 17 00:00:00 2001 From: Chris Beams Date: Sat, 7 Aug 2010 13:57:07 +0000 Subject: [PATCH] Clarify ServletException is thrown when no view is resolved (SPR-7339) --- .../org/springframework/web/servlet/DispatcherServlet.java | 1 + spring-framework-reference/src/mvc.xml | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/DispatcherServlet.java b/org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/DispatcherServlet.java index a49eb92b87..67d38c2750 100644 --- a/org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/DispatcherServlet.java +++ b/org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/DispatcherServlet.java @@ -1031,6 +1031,7 @@ public class DispatcherServlet extends FrameworkServlet { * @param mv the ModelAndView to render * @param request current HTTP servlet request * @param response current HTTP servlet response + * @throws ServletException if view is missing or cannot be resolved * @throws Exception if there's a problem rendering the view */ protected void render(ModelAndView mv, HttpServletRequest request, HttpServletResponse response) throws Exception { diff --git a/spring-framework-reference/src/mvc.xml b/spring-framework-reference/src/mvc.xml index ca24d78745..a06485d015 100644 --- a/spring-framework-reference/src/mvc.xml +++ b/spring-framework-reference/src/mvc.xml @@ -2027,9 +2027,9 @@ public class TimeBasedAccessInterceptor extends HandlerInterceptorAdapter { If a specific view resolver does not result in a view, Spring examines the context for other view resolvers. If additional view - resolvers exist, Spring continues to inspect them. If - they do not exist, Spring throws an - Exception. + resolvers exist, Spring continues to inspect them until a view is + resolved. If no view resolver returns a view, Spring throws a + ServletException. The contract of a view resolver specifies that a view resolver can return null to indicate the view could not be