TechnoBuzz

A Techno Blog, mainly about Java

Jayson JSON

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://jackson.codehaus.org/

http://wiki.fasterxml.com/JacksonInFiveMinutes

http://wiki.fasterxml.com/ObjectMapper

Jackson 2.0

http://www.mkyong.com/spring-mvc/spring-3-mvc-and-json-example/

March 6, 2013 Posted by | IoC, Spring | Leave a comment