liveBook · Manning

@postmapping

@PostMapping is a Spring MVC annotation that maps HTTP POST requests to a controller method.

How 2 Manning books explain it

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

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.