From d9ef3a5321213a579fb83f59e07e764c553aa72c Mon Sep 17 00:00:00 2001 From: BGuga Date: Wed, 13 Sep 2023 10:20:29 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20HandlerExecution=20=EC=9E=AC=EC=A0=95?= =?UTF-8?q?=EC=9D=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/servlet/mvc/tobe/HandlerExecution.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/mvc/src/main/java/webmvc/org/springframework/web/servlet/mvc/tobe/HandlerExecution.java b/mvc/src/main/java/webmvc/org/springframework/web/servlet/mvc/tobe/HandlerExecution.java index 37c583fbdf..1e45958aec 100644 --- a/mvc/src/main/java/webmvc/org/springframework/web/servlet/mvc/tobe/HandlerExecution.java +++ b/mvc/src/main/java/webmvc/org/springframework/web/servlet/mvc/tobe/HandlerExecution.java @@ -2,11 +2,21 @@ import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; +import java.lang.reflect.Method; import webmvc.org.springframework.web.servlet.ModelAndView; public class HandlerExecution { - public ModelAndView handle(final HttpServletRequest request, final HttpServletResponse response) throws Exception { - return null; + private final Object handler; + private final Method handlerMethod; + + public HandlerExecution(Object handler, Method handlerMethod) { + this.handler = handler; + this.handlerMethod = handlerMethod; + } + + public ModelAndView handle(HttpServletRequest request, + HttpServletResponse response) throws Exception { + return (ModelAndView) handlerMethod.invoke(handler, request, response); } }