springmvc的常用注解及用法 springmvc中的controller常用的注解有哪些?
springmvc中的controller常用的注解有哪些?pring MVC 常用的注解有:@Controller@ResquestMapping 用來定義訪問URL,可以為整個類定義,也可以單個的
springmvc中的controller常用的注解有哪些?
pring MVC 常用的注解有:@Controller@ResquestMapping 用來定義訪問URL,可以為整個類定義,也可以單個的為每個方法定義一個@PathVariable@ModelAttribute 獲取頁面參數(shù)@ResquestParam@ResponseBody@SessionAttributes session管理@CookieValue 獲取cookie信息我們重點了解常用的注解@Controler和@ResquestMapping@Controller:表明某個類是一個controller @ResquestMapping:請求路徑映射,常常標注在一個類的方法上,也可以標注在整個類上,表明某個具體的方法來接受處理某次請求,標注在類上,表明訪問此類路徑下的方法(方法要單獨標注配置路徑,也就是請求路徑,同上)