Reputation: 508
No configuration or annotation is needed when setting request header "Accept=application/json"
Upvotes: 0
Views: 618
Reputation: 689
In my situation, I fixed it with using another source for Jackson, because @RequestBody does not converted to the type I expect.
Instead of Codehause Jackson, I use now fasterxml:
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.3.3</version>
</dependency>
Upvotes: 0
Reputation: 508
It does work automatically - in my controller I used an incorrect annotation - I used @RequestParam - it must be @RequestBody
Upvotes: 0
Reputation: 1111
It's almost automatic. Referring to
Jackson is automatically selected and registered when it is in the classpath (i.e. pom.xml) and you use mvc:annotation-driven in your context config.
Upvotes: 1