Http status 406 Not Acceptable

来源:互联网 发布:centos安装wget 编辑:程序博客网 时间:2024/06/04 00:57

One:What is this ?

  • HTTP response status codes :
client error response code indicates that a response matching the list of acceptable values defined in Accept-Charset and Accept-Language cannot be served.

Two:How to resolve 406 problem when using @ResponseBody return json data ?

  • anwser :
    (1): Missing jar package
    (2): jar Conflict with others

  • if you use Spring 3.x jar,please following me(Maven Repository-Spring 3.x.jar)

    # jackson-mapper-asl.jar
    #jackson-core-asl.jar

  • if you use Spring 4.x jar,please following me(Maven Repository-Spring 4.x.jar)

    # jackson-databind.jar
    # jackson-core.jar
    # jackson-annotations.jar

  • Importantly, in Spring Configuration file,add <mvc:annotation-driven />

原创粉丝点击