@GetMapping
Learn @GetMapping (Controllers, Spring MVC) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
Fresher Notes @GetMapping maps HTTP GET requests to a method; it is the shortcut for @RequestMapping(method = RequestMethod.GET) . Use it for reads : fetching a list or one item, searching and downloading. A GET must not change server data. Input comes from the path ( @PathVariable ) and the query string ( @RequestParam ), because GET has no body.
More lessons in Controllers
- @Controller
- @RestController
- Controller Lifecycle
- Controller Methods
- Request Mapping
- @RequestMapping
- @PostMapping
- @PutMapping
- @DeleteMapping
- @PatchMapping
- Mapping HTTP Methods
- Mapping URL Paths
- Class-Level Mapping
- Method-Level Mapping
- Multiple URL Mappings
- Consumes
- Produces
- Mini Project: Controller Types and Mapping Rules