Announcement Announcement Module
Collapse
No announcement yet.
Spring MVC - Controller returning Model not serializing into JSON Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring MVC - Controller returning Model not serializing into JSON

    I have an MVC application that was running Spring 3.0.4 and included Jackson 1.8 jars in classpath. Using annotation driven configuration, the controller methods (using @ResponseBody) return a Spring Model object that auto-magically get converted into JSON in the Response.

    Everything stopped working when I upgraded to Spring 3.2.3 and Jackson 2.2. The controller returns a Model object and the Dispatch servlet no longer returns JSON, it tries to resolve to a JSTL View and a 404 results.

    I verified that I can get things working if I change the Controller method return type from a Model to a Map or one of my domain objects.

    I would like to upgrade without having to change to return types for all of my controller methods. Is is possible to return Models and have them properly serialized into JSON?

    Thanks,
    Scott
Working...
X