diff --git a/mvc/src/main/java/webmvc/org/springframework/web/servlet/DispatcherServlet.java b/mvc/src/main/java/webmvc/org/springframework/web/servlet/DispatcherServlet.java index 40134bf4e9..1199270fec 100644 --- a/mvc/src/main/java/webmvc/org/springframework/web/servlet/DispatcherServlet.java +++ b/mvc/src/main/java/webmvc/org/springframework/web/servlet/DispatcherServlet.java @@ -39,7 +39,7 @@ protected void service(final HttpServletRequest request, final HttpServletRespon final Object handler = handlerMappings.getHandler(request); final HandlerAdapter handlerAdapter = handlerAdapters.getHandlerAdapter(handler); final ModelAndView modelAndView = handlerAdapter.handle(request, response, handler); - render(modelAndView, request, response); + modelAndView.render(modelAndView.getModel(), request, response); } catch (HandleException e) { log.error("HandleException: {}", e.getMessage(), e); response.sendError(HttpServletResponse.SC_NOT_FOUND); @@ -48,10 +48,4 @@ protected void service(final HttpServletRequest request, final HttpServletRespon throw new ServletException(e.getMessage()); } } - - private void render(final ModelAndView modelAndView, final HttpServletRequest request, - final HttpServletResponse response) - throws Exception { - modelAndView.render(modelAndView.getModel(), request, response); - } }