SpringMVC之組合注解@GetMapping


  Spring4.3中引進了{@GetMapping、@PostMapping、@PutMapping、@DeleteMapping、@PatchMapping},來幫助簡化常用的HTTP方法的映射,並更好地表達被注解方法的語義。
  以@GetMapping為例,Spring官方文檔說:
  @GetMapping是一個組合注解,是@RequestMapping(method = RequestMethod.GET)的縮寫。該注解將HTTP Get 映射到 特定的處理方法上。

  Difference between @GetMapping & @RequestMapping:
@GetMapping does not support  the consumes attribute of @RequestMapping.


原文鏈接:https://blog.csdn.net/webzhuce/article/details/53319468


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM