Skip to main content

@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