課程
/后端開發
/Java
/SpringMVC數據綁定入門
嘗試了很多次,一直報406,客戶端請求后服務端能接受到參數,但是一直無法響應,報406.
2016-06-15
源自:SpringMVC數據綁定入門 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 回復 jquery 提問者
舉報
Geely帶你認識SpringMVC各種數據綁定,學習相關注解的使用
2 回答請求錯誤-400
1 回答400錯誤問題解答
6 回答JSON章節返回415報錯
1 回答沒有jar包,不會報錯嗎?
1 回答不論是綁定list還是map都返回400錯誤啊
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
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