@GetMapping | @RequestMapping | @Getmapping annotation | @RequestMapping annotation | okay java

Publié le: 27 janvier 2022
sur la chaîne: okay java
3,665
61

#@GetMapping | #@RequestMapping | #okayjava
@GetMapping | @RequestMapping | @Getmapping annotation | @RequestMapping annotation | okay java
Buy me a coffee - https://www.buymeacoffee.com/okayjava

@GetMapping == @RequestMapping(method = RequestMethod.GET)
@GetMapping is a shortcut for @RequestMapping(method = RequestMethod.GET)

Originally, Spring had only @RequestMapping annotation for mapping all the incoming HTTP request URLs to the corresponding controller methods.
@RequestMapping(value = "/users", method = RequestMethod.GET)
public Users getUsers() {
}
@RequestMapping(value = "/users/{id}", method = RequestMethod.GET)
public User getUser(@PathVariable("id") String id) {
}

Spring 4.3 introduced five new and more specific annotations for each HTTP request type.

@GetMapping == @RequestMapping(method = RequestMethod.GET)
@PostMapping == @RequestMapping(method = RequestMethod.POST)
@PutMapping == @RequestMapping(method = RequestMethod.PUT)
@DeleteMapping ==@RequestMapping(method = RequestMethod.DELETE)
@PatchMapping == @RequestMapping(method = RequestMethod.PATCH)

@RequestMapping(value = "/users", method = RequestMethod.GET)
public Users getUsers() {
}
@GetMapping(value = "/users")
public Users getUsers() {
}
@RequestMapping(value = "/users/{id}", method = RequestMethod.GET)
public User getUser(@PathVariable("id") String id) {
}
@GetMapping(value = "/users/{id}")
public User getUser(@PathVariable("id") String id) {
}


Sur cette page du site, vous pouvez voir la vidéo en ligne @GetMapping | @RequestMapping | @Getmapping annotation | @RequestMapping annotation | okay java durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur okay java 27 janvier 2022, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 3,665 fois et il a aimé 61 téléspectateurs. Bon visionnage!