Binding requests and marshalling responses

This recipe explains how to configure Spring MVC for REST handlers to be as integrated as possible with their business domain. We focus on designing self-explanatory method handlers, externalized type conversions, and abstracted response marshalling (serialization to specific formats such as json, xml, csv, and so on).

Getting ready

We are going to review the configuration changes applied to the cloudstreetmarket-api webapp in order to set up a Type conversion from either a request parameter or a URI template variable.

We will see how to configure automatic marshalling (for responses) into json. We will focus on two very simple method handlers created for this chapter.

How to do it...

The following steps describe ...

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.