back/Spring Framework
[Spring Fw] application context vs. servlet context
펭귄대장
2020. 5. 7. 21:02
application context
최상위 context
여러개의 servlet 에서 공통적으로 공유하여 사용할 수 있는 Bean 을 선언
Spring 에서 생성되는 Bean 에 대한 Ioc Container
application context 에 정의된 bean 은 servlet context에 정의된 bean 을 사용할 수 없다
servlet context
servlet 관련된 context
url 관련 설정 bean 생성 (intercepter, @Controller)
application context 를 부모 context 로 사용
application context와 servlet context에 같은 id 로 bean 등록된 경우 servlet context 의 bean을 사용한다.
* 빈 색인 순서
servlet context 에서 bean 을 못 찾을 경우 application context 에서 bean 을 찾는다.
https://jaehun2841.github.io/2018/10/21/2018-10-21-spring-context/
https://www.baeldung.com/spring-web-contexts
반응형