Http status 406 Not Acceptable

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 />

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章