Spring 4.3 新增加的请求注解,对@RequestMapping()进行了细分
Spring 4.3针对注册请求增加了5个新注册分别如下:
1)、@GetMapping 相当于Get请求(@RequestMapping(method=RequestMethod.GET))
2)、@PostMapping 相当于POST请求 (@RequestMapping(method=RequestMethod.POST))
3)、PutMapping 相当于PUT请求 (@RequestMapping(method=RequestMethod.PUT))
4)、DeleteMapping 相当于DELETE请求 (@RequestMapping(method=RequestMethod.DELETE))
5)、PatchMapping 相当于PATCH请求 (@RequestMapping(method=RequestMethod.PATCH))
Spring4.3引入了5个新的请求映射注解,包括@GetMapping、@PostMapping、@PutMapping、@DeleteMapping和@PatchMapping,这些注解简化了HTTP请求的处理。
2万+

被折叠的 条评论
为什么被折叠?



