Spring mvc @ResponseBody jquery ajax调用出现如下错误:406 Not Acceptable


controller执行正常,jquery.ajax始终无法执行回调函数

 

The resource identified by this request is only capable of generating responses with characteristics not acceptable according to the request "accept" headers ().

 

需要加入jackson依赖:

        <!-- json -->
        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-core-lgpl</artifactId>
            <version>1.9.0</version>
        </dependency>
        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-mapper-lgpl</artifactId>
            <version>1.9.0</version>
        </dependency>

你可能感兴趣的:(@ResponseBody)