Skip to content

Commit

Permalink
refactor: DispatcherServlet 불필요한 render 메서드 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
somsom13 committed Sep 25, 2023
1 parent 798690c commit 92e6c21
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
}
}

0 comments on commit 92e6c21

Please sign in to comment.