@getmapping
@GetMapping is a Spring MVC annotation that maps HTTP GET requests for a specified path to a controller method.
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
- HTTP GETconfigures · HTTP GET is a safe, idempotent HTTP method that requests a representation of a resource without intending to change its state.
- endpointconfigures · An endpoint is an addressable interface of a service through which clients access a resource or invoke an operation, typically via a network request.
- RESTuses · REST is an architectural style for distributed systems that organizes interactions around identifiable resources and their representations, using a uniform interface and constraints such as statelessness and cacheability.
- @postmappingcontrasts with · @PostMapping is a Spring MVC annotation that maps HTTP POST requests to a controller method.
- @requestmappingconfigured by · @RequestMapping is a Spring annotation that associates HTTP request patterns and conditions with controller classes or handler methods.
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.

