Extending REST handlers to all HTTP methods
This is the core recipe of the chapter. We will detail how to use the Spring MVC method-handlers for HTTP methods that we haven't covered yet: the non-readonly ones.
Getting ready
We will see the returned status codes and the HTTP standards driving the use of the PUT
, POST
, and DELETE
methods. This will get us to configure HTTP-compliant Spring MVC controllers.
We will also review how request-payload mapping annotations such as @RequestBody
work under the hood and how to use them efficiently.
Finally, we open a window on Spring transactions, as it is a broad and important topic in itself.
How to do it…
Following the next steps will present the changes applied to two controllers, a service and a repository: ...
Get Spring MVC: Designing Real-World Web Applications now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.