課程
/后端開發(fā)
/Java
/SpringMVC數(shù)據(jù)綁定入門
嘗試了很多次,一直報406,客戶端請求后服務(wù)端能接受到參數(shù),但是一直無法響應(yīng),報406.
2016-06-15
源自:SpringMVC數(shù)據(jù)綁定入門 6-1
正在回答
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>
姜岑
我來:如果你的依賴的SpringMVC的包版本是4.0.9以上的,那么就不能用視屏中的jackson.jar ?依賴用這三個:
<dependency>
? ? <groupId>com.fasterxml.jackson.core</groupId>
? ? <artifactId>jackson-databind</artifactId>
? ? <version>2.5.0</version>
</dependency>
? ? <artifactId>jackson-core</artifactId>
? ? <artifactId>jackson-annotations</artifactId>
xiplus329
spring mvc有沒有配置<mvc:annotation-driven/>
是不是json包沒有正確引入jackson-annotations-2.x.jar /jackson-core-2.x.jar/jackson-databind-2.x.jar
jquery 提問者
慕村6551120 回復(fù) jquery 提問者
舉報
Geely帶你認(rèn)識SpringMVC各種數(shù)據(jù)綁定,學(xué)習(xí)相關(guān)注解的使用
2 回答請求錯誤-400
1 回答400錯誤問題解答
6 回答JSON章節(jié)返回415報錯
1 回答沒有jar包,不會報錯嗎?
1 回答不論是綁定list還是map都返回400錯誤啊
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網(wǎng)安備11010802030151號
購課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號
2018-12-30
1、在pom文件中需引入
2、在applicationContext.xml配置文件中引入即可。
2016-11-15
我來:如果你的依賴的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>
2016-06-15
spring mvc有沒有配置<mvc:annotation-driven/>
是不是json包沒有正確引入jackson-annotations-2.x.jar /jackson-core-2.x.jar/jackson-databind-2.x.jar
2016-06-15
spring mvc有沒有配置<mvc:annotation-driven/>
是不是json包沒有正確引入jackson-annotations-2.x.jar /jackson-core-2.x.jar/jackson-databind-2.x.jar