0

ステータス コードを 406 として取得する"The resource identified by this request is only capable of generating responses with characteristics not acceptable according to the request "accept" headers."

spring バージョンを (3.1.23.2.13) アップグレードしているときに、サーバーから 406 エラーが発生します。

Content-Type of Response headers:"Content-Type:text/html;charset=utf-8". 
Request Header is Accept: application/json, text/javascript, */*; q=0.01. 
JavaCode:"@RequestMapping(value = "/search",method = RequestMethod.POST,consumes = "application/json", produces = "application/json")".

Ajax 呼び出し:

$.ajax({    
            url : /search.htm,
            dataType : json,
            data : postData,
            contentType: application/json,
            .
            .
            .});
  • 春 3.2.13
  • ジャクソン-注釈-2.1.2
  • ジャクソン-コア-2.1.2
  • ジャクソン-コア-asl-1.9.9
  • ジャクソン-データバインド-2.1.2
  • ジャクソン-マッパー-asl-1.9.9

ただし、次の構成を使用している間は、完全に機能します。(ここContent-Typeの応答ヘッダーapplication/json:)

  • 春 3.1.2
  • ジャクソン-コア-asl-1.9.9
  • ジャクソン-マッパー-asl-1.9.9

この問題を解決するのを手伝ってください。

4

0 に答える 0