결국엔 (굉장히 복잡한) 서블릿.
= DispatcherServlet
DispatcherServlet 초기화
스프링 부트 사용하지 않는 스프링 MVC
public class WebApplication implements WebApplicationInitializer {
@Override
public void onStartup(ServletContext servletContext) throws ServletException {
AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext();
context.register(WebConfig.class);
context.refresh();
DispatcherServlet dispatcherServlet = new DispatcherServlet(context);
ServletRegistration.Dynamic app = servletContext.addServlet("app", dispatcherServlet);
app.addMapping("/app/*");
}
}
스프링 부트를 사용하는 스프링 MVC
External Libraries -> maven : org.springframework.boot:spring-boot-autoconfigure:2.5.1 -> spring-boot-autoconfigure-2.5.1.jar -> META-INF -> spring.factories
스프링 부트가 기본으로 등록한 빈 : WebMvcAutoConfiguration.class
참고