1. 程式人生 > >SpringMVC的對映器和介面卡

SpringMVC的對映器和介面卡

處理器對映器

BeanNameUrlHandlerMapping

功能:尋找Controller

           根據url請求去匹配bean的name屬性url,從而獲取Controller

 

SimpleUrlHandlerMaping

功能:尋找Controller

           根據瀏覽器url匹配簡單url的key,key又Controller的id找到Controller

 

 

ControllerClassNameHandlerMapping

功能:尋找Controller

            根據類名(MyController)類名.do來訪問,類名首字母小寫

 

 

對映器之間能不能共存?

3個處理器對映器可以共存。

處理器介面卡

SimpleControllerHandlerAdapter

功能:執行controller

           呼叫controller裡面方法,返回modelAndView。

 

 

HttpRequestHandlerAdapter

功能:執行controller

 

 

 

2個處理器介面卡能共存?

可以共存