Friday, April 13, 2012

Adding Jackson to a SpringMVC project for JSON mapping

Here are the dependencies you'll need for SpringMVC to automatically map objects to JSON objects.



And here is an example of a method in a controller (Note the returning type is a simple pojo and your request should specify "application/json" as the accept type):


UPDATE - And it also looks like this also works as an alternative to the above dependencies:

No comments:

Post a Comment