@GetMapping和@RequestMapping之间的区别(method = RequestMethod.GET)
@GetMapping和@RequestMapping(method = RequestMethod.GET)什么区别?
我在一些Spring Reactive示例中@GetMapping ,使用了@GetMapping而不是@RequestMapping
@GetMapping是一个组合的注释,作为@RequestMapping(method = RequestMethod.GET)的快捷方式。
@GetMapping是更新的注释。 它支持消费
消费选项是:
consumes =“text / plain”
consumes = {“text / plain”,“application / *”}
有关更多详细信息,请参阅: GetMapping注释
或者读取: 请求映射变体
正如你所看到的:
具体来说,
@GetMapping是一个组合的注释,作为@RequestMapping(method = RequestMethod.GET)的快捷方式。
@GetMapping和@RequestMapping之间的@GetMapping
@GetMapping不支持@RequestMapping@GetMapping属性。