@postmapping
@PostMapping is a Spring MVC annotation that maps HTTP POST requests to a controller method.
Spring in Action, Sixth Edition
@PostMapping is a Spring MVC annotation that maps HTTP POST requests to a controller method.
- How it is used
- Maps form-submission POST requests to Spring MVC controller methods.
- How deep it goes
- Explains a handler’s path, form binding, model attribute, and redirect through a working example.
- Examples
- Uses a taco design form and a controller method that adds a submitted taco to an order.
- What you can do after
- Apply it via Spring MVC to route a POST form submission to a controller method.
Read how Spring in Action, Sixth Edition explains @postmapping →
Spring Start Here, Second Edition
The @PostMapping annotation maps a Spring MVC method to HTTP POST requests for a specified path.
- How it is used
- Routes HTTP POST requests to a controller action, such as adding a product.
- How deep it goes
- Shows path mapping and a product-action example, and contrasts dedicated method annotations with @RequestMapping.
- Examples
- Demonstrates adding a product through a POST action and an HTML form targeting /products.
- What you can do after
- Apply @PostMapping to route a form submission to a Spring MVC action that adds a product.
Read how Spring Start Here, Second Edition explains @postmapping →
Related concepts
- HTTP requestuses · An HTTP request is a message sent by a client to a server using the Hypertext Transfer Protocol, specifying a method and target and optionally including headers and a body.
- POSTconfigures · POST is an HTTP request method that asks the target resource to process the representation enclosed in the request according to its own semantics.
- Spring MVCused by · Spring MVC is Spring’s web framework for handling HTTP requests and responses using the Model-View-Controller pattern.
- controllerconfigures · A controller is a software component that receives input or requests and coordinates other components or operations to produce a response or change application state.
- 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.
Questions about @postmapping
What is @postmapping?
@PostMapping is a Spring MVC annotation that maps HTTP POST requests to a controller method.
Which Manning books explain @postmapping?
Spring in Action, Sixth Edition and Spring Start Here, Second Edition.
What is the difference between @postmapping and @writeoperation?
@PostMapping is a Spring MVC annotation that maps HTTP POST requests to a controller method. @WriteOperation is a Spring Boot Actuator annotation that marks a method as an operation for modifying endpoint state.
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.

