美文网首页
Spring @RequestMapping中的method

Spring @RequestMapping中的method

作者: 我想起个好名字 | 来源:发表于2018-08-13 15:12 被阅读0次

method 

method属性是指请求的方式。

组合注解(RequestMapping的变形)

@GetMapping = @(method = RequestMethod.GET)

@PostMapping = @RequestMapping(method = RequestMethod.POST)

@PutMapping = @RequestMapping(method = RequestMethod.PUT)

@DeleteMapping = @RequestMapping(method = RequestMethod.DELETE)

组合注解是方法级别的,只能用在方法上,我们的实例基本都用组合注解。

相关文章

网友评论

      本文标题:Spring @RequestMapping中的method

      本文链接:https://www.haomeiwen.com/subject/ohlubftx.html