DevBoi

[Spring] Spring 구동 과정 본문

Develop/[Spring]

[Spring] Spring 구동 과정

HiSmith 2022. 3. 24. 23:42
반응형

1. 웹 어플리케이션이 시작되면 web.xml이 로딩된다.

2. web.xml 에 등록되어있는 ContextLoaderListener가 생성

3.ContextLoadListener는 ServletContextListener를 구현, ApplicationContext를 생성한다.

(ApplicationContext는 Ioc 엔진이며, 빈의 생명주기를 담당한다.)

3.ContextLoadLinstener가 ApplicationContext를 생성하면서, root-context를 로딩

ContextLoaderListener : 서블릿을 초기화하는 용도로 사용된다.

4.root-context에 등록되어있는 설정에 따라 Spring container가 구동

5.클라이언트로부터 Web Application에 요청

6.DispatcherServlet이 생성

7.DispatcherServlet이 servlet-context를 로딩

8.두번째 스프링 컨테이너가 생성 되며, 응답에 맞게 PageController 동작

 

 



반응형

'Develop > [Spring]' 카테고리의 다른 글

[Spring] 컨테이너  (0) 2022.03.25
[Spring] MVC1 과 MVC2의 차이  (0) 2022.03.24
[Spring] Spring 과 SpringBoot의 차이  (0) 2022.03.24
[Spring] 스프링의 동작방식  (0) 2022.03.24
[Spring] Spring 의 정의 및 특징  (0) 2022.03.24