diff --git a/README.md b/README.md index c07df69098..6c26624fdb 100644 --- a/README.md +++ b/README.md @@ -16,4 +16,4 @@ - [x] DispatcherServlet이 아닌 뷰에서 JSP를 반환하도록 수정 - [x] REST API를 지원할 수 있도록 Json 뷰를 추가 - [x] Legacy MVC 제거 -- [ ] DispatcherServlet도 app 패키지가 아닌 mvc 패키지로 이동 +- [x] DispatcherServlet도 app 패키지가 아닌 mvc 패키지로 이동 diff --git a/app/src/main/java/com/techcourse/AppWebApplicationInitializer.java b/app/src/main/java/com/techcourse/AppWebApplicationInitializer.java index e091e7e249..5a23a00f20 100644 --- a/app/src/main/java/com/techcourse/AppWebApplicationInitializer.java +++ b/app/src/main/java/com/techcourse/AppWebApplicationInitializer.java @@ -1,6 +1,7 @@ package com.techcourse; import jakarta.servlet.ServletContext; +import nextstep.mvc.controller.DispatcherServlet; import nextstep.web.WebApplicationInitializer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/app/src/main/java/com/techcourse/DispatcherServlet.java b/mvc/src/main/java/nextstep/mvc/controller/DispatcherServlet.java similarity index 96% rename from app/src/main/java/com/techcourse/DispatcherServlet.java rename to mvc/src/main/java/nextstep/mvc/controller/DispatcherServlet.java index 0f53a7304d..a08cb1edef 100644 --- a/app/src/main/java/com/techcourse/DispatcherServlet.java +++ b/mvc/src/main/java/nextstep/mvc/controller/DispatcherServlet.java @@ -1,4 +1,4 @@ -package com.techcourse; +package nextstep.mvc.controller; import jakarta.servlet.ServletException; import jakarta.servlet.http.HttpServlet; @@ -34,7 +34,6 @@ public DispatcherServlet() { @Override public void init() { handlerMappings.addHandlerMapping(new AnnotationHandlerMapping("com.techcourse.controller")); - handlerMappings.addHandlerMapping(new ManualHandlerMapping()); handlerAdapters.addHandlerAdapter(new HandlerExecutionHandlerAdapter()); handlerAdapters.addHandlerAdapter(new ControllerHandlerAdapter()); diff --git a/app/src/main/java/com/techcourse/ManualHandlerMapping.java b/mvc/src/main/java/nextstep/mvc/controller/tobe/ManualHandlerMapping.java similarity index 96% rename from app/src/main/java/com/techcourse/ManualHandlerMapping.java rename to mvc/src/main/java/nextstep/mvc/controller/tobe/ManualHandlerMapping.java index 4a72a4127f..f427ccfcd5 100644 --- a/app/src/main/java/com/techcourse/ManualHandlerMapping.java +++ b/mvc/src/main/java/nextstep/mvc/controller/tobe/ManualHandlerMapping.java @@ -1,4 +1,4 @@ -package com.techcourse; +package nextstep.mvc.controller.tobe; import jakarta.servlet.http.HttpServletRequest; import nextstep.mvc.HandlerMapping;