SpringMVC之组合注解@GetMapping

来源:互联网 发布:新能源汽车产销数据 编辑:程序博客网 时间:2024/05/16 15:24
  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 theconsumesattribute of@RequestMapping.
0 0
原创粉丝点击