티스토리 뷰

Request Processing Lifecycle

DispatcherServlet
- entry point of Spring 3.0 MVC
- 보통 HttpServlet base class를 구현한 servlet 클래스이다. 
- web.xml에 구성된다.  



lifecycle of Spring 3.0 MVC 의 Request 처리 lifecycle:
1. client 가 http request 형태로 web containter에서 요청을 보낸다.   
2. 들어온 요청은  Front controller (DispatcherServlet) 가 접수해서 적절한 Handler Mappings을 찾아낸다.  
3. Handler Mappings 의 도움으로,  DispatcherServlet 는 적절한 Contrller 에 request를 보낸다.  
4. Controller 는 request를 처리하고 ModelAndView 인스턴스의 형태로 모델과 뷰를 Front controlle에 보낸다.    
5. The Front Controller 는  View Resolver 객채를 통해 View (which can be JSP, Freemarker, Velocity etc) 를 해석한다. 
6. 선택된 View는 client에 돌아가서 렌더링된다. 

 
WebApplicatonContext
spring-3-mvc-architecture



참고 : Spring 3 MVC – Introduction to Spring 3 MVC Framework
댓글