springmvc註解的處理器映射器和適配器

1、掃盲常識


spring3.1之前使用org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping註解映射器。

 

spring3.1之後使用org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping註解映射器。

 

spring3.1之前使用org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter註解適配器。

 

spring3.1之後使用org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter註解適配器。


2、註解的處理器映射器和適配器


使用註解的映射器和註解的適配器。(註解的映射器和註解的適配器必須配對使用)


2.1、配置註解映射器(spring3.1前後有改動)




2.2、配置註解適配器(spring3.1前後有改動)




3、開發註解Handler







在視圖解析器配置視圖頁面的前綴和後綴




4、訪問測試(項目名要對,查看@RequestMapping("/queryItems8"))




發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章