ContextLoaderListener란?
ServletContextListener의 구현체로 웹애플리케이션의 시작과 종료 이벤트를 처리하는 리스너.
- ContextLoaderListener의 역할은 웹애플리케이션이 실행될 때 ApplicationContext를 만들고 servletContext보관소에 저장하는 것이다.
이렇게 함으로써 서블릿에서는 IoC컨테이너(ApplicationContext 이하 스프링컨테이너)를 ServletContext에서 꺼내 사용할 수 있다.
- ServletContext란?
웹 애플리케이션이 실행될 때 생성되어 종료될때까지 유지되는 데이터 보관소.
Front Controller패턴으로 모든요청을 하나의 Controller가 받아서 해당 요청을 처리할 핸들러들에게 요청을 분배하는것이다.