liveBook · Manning

@getmapping

@GetMapping is a Spring MVC annotation that maps HTTP GET requests for a specified path to a controller method.

How 2 Manning books explain it

Spring in Action, Sixth Edition

@GetMapping is a Spring MVC annotation that maps HTTP GET requests to a controller method.

How it is used
Routes HTTP GET requests to Spring MVC controller methods that return views or prepare model data.
How deep it goes
Explains direct and combined path mapping, view-name returns, and model preparation without descending into framework internals.
Examples
Uses a home-page controller and a taco-design form mapped through class-level and method-level paths.
What you can do after
Apply it via Spring MVC to connect GET URLs with controller methods and rendered logical views.

Read how Spring in Action, Sixth Edition explains @getmapping →

Spring Start Here, Second Edition

The @GetMapping annotation maps a Spring MVC method to HTTP GET requests for a specified path.

How it is used
Maps a controller action to GET requests for a path in a Spring MVC web app.
How deep it goes
Defines the dedicated mapping and contrasts it with @RequestMapping; does not explain framework internals.
Examples
Uses a /products controller action to retrieve products and return an HTML view.
What you can do after
Apply it to map a controller action to GET requests at a chosen path.

Read how Spring Start Here, Second Edition explains @getmapping →

Also covered in

Related concepts

Questions about @getmapping

What is @getmapping?

@GetMapping is a Spring MVC annotation that maps HTTP GET requests for a specified path to a controller method.

Which Manning books explain @getmapping?

Spring in Action, Sixth Edition and Spring Start Here, Second Edition.

What is the difference between @getmapping and @readoperation?

@GetMapping is a Spring MVC annotation that maps HTTP GET requests for a specified path to a controller method. @ReadOperation is a Spring Boot Actuator annotation that marks a method as an operation for reading endpoint data.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.