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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.