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); } }