Spring-MVC 406 Not Acceptable instead of JSON Response

后端 未结 5 1985
天涯浪人
天涯浪人 2020-12-03 08:02

I\'m trying to return a JSON response with Spring 3.0.6, but I get a 406 response \"Not Acceptable\", with the description: \"The resource identified by this request is onl

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-03 08:37

    I ran into this problem because the objects that I wanted to return as JSON didn't have any getter methods for their properties. Jackson probably needs these. After adding them it worked.

提交回复
热议问题