首页 > 代码库 > Spring SpringMvc 406 Not Acceptable

Spring SpringMvc 406 Not Acceptable

406 Not Acceptable

缺少转换依赖的jar包,设置了@ResponseBody,要把对象转换成json格式。

解决方法:

pom.xml文件增加

	<dependency>
		<groupId>org.codehaus.jackson</groupId>
		<artifactId>jackson-core-asl</artifactId>
		<version>1.8.9</version>
	</dependency>
	<dependency>
		<groupId>org.codehaus.jackson</groupId>
		<artifactId>jackson-mapper-asl</artifactId>
		<version>1.8.9</version>
	</dependency>


Spring SpringMvc 406 Not Acceptable