springmvc 報406錯誤

詳細錯誤如下:

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


我代碼返回的是JSON字串,其它各種service,controller均是用的註解方式


解決方法是:在springmvc.xml中加上 


<mvc:annotation-driven/>


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