1、检查是否引入了必要的jar包
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.1.0</version>
</dependency>
2、网上各种spring-servlet.xml的配置都是非必要的,只需要以下配置即可
<mvc:annotation-driven />
<context:component-scan base-package="com.package" />
<context:annotation-config />
3、如果以上还是不能解决,请检查在web.xml中配置的spring拦截后缀, 不要使用.html后缀!
我解决这个问题,前面都是铺垫,真正导致406的原因其实是这个,以下答案提醒了我: