spring mvc 接收json 异常 Unsupported Media Type

前台ajax传json到controller,就是报Unsupported Media Type。前台设置contentType:'application/json',后台
@RequestMapping(value="add",method=RequestMethod.POST,headers="Accept=application/json")
	@ResponseBody
	public String add(@RequestBody Department department){
		departmentService.save(department);
		return department.getId();
	}
感觉确实没问题,后台搜来搜去找到了狗血的问题,没引入jackson-mapper-asl-1.9.11.jar和jackson-core-asl-1.9.11.jar。直接提示class not found 不行么大哥。又快十二点了

你可能感兴趣的:(spring mvc 接收json 异常 Unsupported Media Type)