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.
Simply put, this blog is a dumping ground for things I find interesting or worth remembering relating to Java, programming, web, lean, agile, etc, etc.
Showing posts with label jackson. Show all posts
Showing posts with label jackson. Show all posts
Thursday, July 26, 2012
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:
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:
Subscribe to:
Posts (Atom)