Showing posts with label jackson. Show all posts
Showing posts with label jackson. Show all posts

Thursday, July 26, 2012

SpringMVC 3 Serialize enums to JSON

Apparently Jackson and SpringMVC 3 doesn't know how to handle enum properties when serializing to json, however there is a solution and this stack overflow thread has it.

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: