Marshalling : takes your custom objects and converts them to XML, JSON or other serialization formats.
Unmarshalling : creation of custom objects from XML
Gunner Hillert : “The easiest way to marshal JSON in Spring MVC is via the Jackson Java JSON-processor“
Create JSON response from Spring MVC 3 : ”Spring MVC invokes a MappingJacksonHttpMessageConverter built on the Jackson JSON processor. This implementation is enabled automatically when you use the mvc:annotation-driven configuration element with Jackson present in your classpath”
The @ResponseBody
annotation is similar to @RequestBody
: “ This annotation can be put on a method and indicates that the return type should be written straight to the HTTP response body (and not placed in a Model, or interpreted as a view name).”
Spring MVC wth @ResponseBody : “Spring will automatically marshall the return value of an annotated method to XML, JSON, etc. “
From SpringSource : “Underneath the covers, Spring MVC delegates to a HttpMessageConverter to perform the serialization. In this case, Spring MVC invokes a MappingJacksonHttpMessageConverter built on the Jackson JSON processor. This implementation is enabled automatically when you use the mvc:annotation-driven configuration element with Jackson present in your classpath.”
http://wiki.fasterxml.com/JacksonInFiveMinutes
http://wiki.fasterxml.com/ObjectMapper
http://www.mkyong.com/spring-mvc/spring-3-mvc-and-json-example/