1. 程式人生 > >springmvc 註解帶示例

springmvc 註解帶示例

app ces 兩個 變量 del mode div control 返回對象

http://www.cnblogs.com/leskang/p/5445698.html Springmvc 註解
@Controller() @Autowired //spring 提供註解,通過類型裝配 @ModelAtrrbuter("/url") //用在controller方法執行之前執行。 @requestMapping(value="", method="", params{"name=aa","pas"} , 必須攜帶的參數,且name="aa",pas 值不指定這兩個參數時方法才執行 @RequestParam("petId") ,//相當request.getParameter("petId") consumes=" 請求的提交內容類型", produces="返回的內容類型" ) @ResponseBody 將返回對象寫入到Response對象的body中 @pathVariable 將url 模板中的變量參數映射到方法參數上
@Service() imp 實現類上使用 @Respority()//daoimpl 註解 @Component //通用註解 盡量不使用 http://jinnianshilongnian.iteye.com/blog/1594806

springmvc 註解帶示例