Spring MVC: jackson-mapper-asl not work with Spring 4
With spring 4
, we need to use following dependency:
<dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>2.5.1</version></dependency>
The jackson-mapper-asl
is used with spring 3.x
. Thanks to @Master Slave for valid comment. Click here for more information: Spring 4 RestController JSON: characteristics not acceptable according to the request "accept" headers
I think you used in valid path variable param type ex:
@RequestMapping(value="/find-sub-categories/{parentId}", method=RequestMethod.GET)@ResponseBody public List<ProductCategory> findSubCategories@PathVariable(value="parentId") ProductCategory productCategory)
instead of it, use the following method header it may work
@ResponseBody public List<ProductCategory> findSubCategories(@PathVariable Integer parentId)