About @GetMapping
- The @GetMapping annotation ensures that HTTP GET requests to /path are mapped to the methodName() method.
- There are companion annotations for other HTTP verbs (e.g. @PostMapping for POST).
- There is also a @RequestMapping annotation that they all derive from, and can serve as a synonym (e.g. @RequestMapping(method=GET)).