Spring MVC Controller, WebSphere Traditional, JSON
DougBreaux 270007SMYJ Visits (7418)
Just a quick note on doing JSON with Spring MVC, under WebSphere 8.5.5 Traditional.
This version of WebSphere includes Jackson 1.6.2 under the covers, for JSON serialization. (Apparently in WebSphere Liberty, the included Jackson isn't available for applications to directly use, but it is in WebSphere Traditional. On Liberty, you have to deploy your own copy of Jackson anyway.)
Spring 4.x "consumes" and "produces" attributes can auto serialize JSON, but apparently only if Jackson 2.x is in the classpath.
Without that, my attempts to send JSON requests resulted in, "415 Unsupported Media Type".
However, because Jackson 1.x and 2.x use different Java packages (org
Quick example of such a Spring controller method, just for reference:
(Assuming, of course, that your request/response classes are annotated with JAXB annotations. And/or Jackson-specific annotations as well, if you need any of those.)