第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定

一直報406錯誤

嘗試了很多次,一直報406,客戶端請求后服務(wù)端能接受到參數(shù),但是一直無法響應(yīng),報406.

正在回答

4 回答

1、在pom文件中需引入

<dependency>
??<groupId>com.fasterxml.jackson.core</groupId>
??<artifactId>jackson-databind</artifactId>
??<version>2.9.6</version>
</dependency>

2、在applicationContext.xml配置文件中引入即可。

<mvc:annotation-driven>
????<mvc:message-converters>
????????<bean?class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter"></bean>
????</mvc:message-converters>
</mvc:annotation-driven>


0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

姜岑

直接在 <beans> </beans>標(biāo)簽中加上嗎?
2019-09-29 回復(fù) 有任何疑惑可以回復(fù)我~

我來:如果你的依賴的SpringMVC的包版本是4.0.9以上的,那么就不能用視屏中的jackson.jar ?依賴用這三個:

<dependency>

? ? <groupId>com.fasterxml.jackson.core</groupId>

? ? <artifactId>jackson-databind</artifactId>

? ? <version>2.5.0</version>

</dependency>

<dependency>

? ? <groupId>com.fasterxml.jackson.core</groupId>

? ? <artifactId>jackson-core</artifactId>

? ? <version>2.5.0</version>

</dependency>

<dependency>

? ? <groupId>com.fasterxml.jackson.core</groupId>

? ? <artifactId>jackson-annotations</artifactId>

? ? <version>2.5.0</version>

</dependency>


1 回復(fù) 有任何疑惑可以回復(fù)我~
#1

xiplus329

多謝!
2017-05-18 回復(fù) 有任何疑惑可以回復(fù)我~
  1. spring mvc有沒有配置<mvc:annotation-driven/>

  2. 是不是json包沒有正確引入jackson-annotations-2.x.jar /jackson-core-2.x.jar/jackson-databind-2.x.jar

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

jquery 提問者

沒有,你說的這兩種情況我這都不存在。一直都是這樣的錯誤: org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/octet-stream' not supported at .....
2016-06-15 回復(fù) 有任何疑惑可以回復(fù)我~
#2

慕村6551120 回復(fù) jquery 提問者

spring版本是3.x以上的需要jackson2.x的包,因?yàn)閟pring3.x以上的版本創(chuàng)建MappingJackson2HttpMessageConverter而以前的版本是創(chuàng)建了MappingJacksonHttpMessageConverter對象。
2017-09-28 回復(fù) 有任何疑惑可以回復(fù)我~
  1. spring mvc有沒有配置<mvc:annotation-driven/>

  2. 是不是json包沒有正確引入jackson-annotations-2.x.jar /jackson-core-2.x.jar/jackson-databind-2.x.jar

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報

0/150
提交
取消
SpringMVC數(shù)據(jù)綁定入門
  • 參與學(xué)習(xí)       70565    人
  • 解答問題       66    個

Geely帶你認(rèn)識SpringMVC各種數(shù)據(jù)綁定,學(xué)習(xí)相關(guān)注解的使用

進(jìn)入課程

一直報406錯誤

我要回答 關(guān)注問題
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號