删除 Jackson 1.* 后使用 2.4.4 (JAXRS) 替换它,它将导入所有其他依赖项,jackson-core、jackson-databind 和 jackson-annotations。
已移除
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
<version>1.9.13</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.13</version>
</dependency>
添加
<dependency>
<groupId>com.fasterxml.jackson.jaxrs</groupId>
<artifactId>jackson-jaxrs-base</artifactId>
<version>2.4.4</version>
</dependency>
http://www.codingpedia.org/ama/jquery-ui-autocomplete-not-working-in-spring-4-1/
并在 servlet xml
<mvc:annotation-driven content-negotiation-manager="contentNegotiationManager" />
<bean id="contentNegotiationManager" class="org.springframework.web.accept.ContentNegotiationManagerFactoryBean">
<property name="favorPathExtension" value="false" />
<property name="favorParameter" value="true" />
<property name="mediaTypes" >
<value>
json=application/json
xml=application/xml
</value>
</property>
</bean>
如果在类文件中导入了jackson注解,也应该替换
已移除
导入 org.codehaus.jackson.annotate.JsonIgnoreProperties
添加
导入 com.fasterxml.jackson.annotation.JsonIgnoreProperties