如何處理后臺向前臺傳遞的json數(shù)據(jù)
這篇文章主要介紹了如何處理后臺向前臺傳遞的json數(shù)據(jù),文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下
在pom文件中添加下面三種依賴jar包
<dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-annotations</artifactId> <version>2.9.8</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId> <version>2.9.8</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>2.9.8</version> </dependency>
spring.xml中加入以下bean
<bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter"> <property name="messageConverters"> <list> <ref bean="mappingJacksonHttpMessageConverter" /> </list> </property> </bean> <bean id="mappingJacksonHttpMessageConverter" class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter"> <property name = "supportedMediaTypes"> <list> <bean class="org.springframework.http.MediaType"> <constructor-arg index="0" value="text"/> <constructor-arg index="1" value="plain"/> <constructor-arg index="2" value="UTF-8"/> </bean> <bean class="org.springframework.http.MediaType"> <constructor-arg index="0" value="*"/> <constructor-arg index="1" value="*"/> <constructor-arg index="2" value="UTF-8"/> </bean> <bean class="org.springframework.http.MediaType"> <constructor-arg index="0" value="text"/> <constructor-arg index="1" value="*"/> <constructor-arg index="2" value="UTF-8"/> </bean> <bean class="org.springframework.http.MediaType"> <constructor-arg index="0" value="application"/> <constructor-arg index="1" value="json"/> <constructor-arg index="2" value="UTF-8"/> </bean> </list> </property> </bean>
以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
- JS如何操作DOM基于表格動態(tài)展示數(shù)據(jù)
- vue+vuex+json-seiver實(shí)現(xiàn)數(shù)據(jù)展示+分頁功能
- mockjs+vue頁面直接展示數(shù)據(jù)的方法
- Vue.js 實(shí)現(xiàn)數(shù)據(jù)展示全部和收起功能
- json數(shù)據(jù)傳到前臺并解析展示成列表的方法
- jQuery插件jsonview展示json數(shù)據(jù)
- Springmvc處理ajax請求并返回json數(shù)據(jù)
- 使用fastjson中的JSONPath處理json數(shù)據(jù)的方法
- 對pandas處理json數(shù)據(jù)的方法詳解
- ajax請求后臺接口數(shù)據(jù)與返回值處理js的實(shí)例講解
- ajax處理返回的json格式數(shù)據(jù)方法
- js前端對于大量數(shù)據(jù)的展示方式及處理方法
相關(guān)文章
詳解SpringBoot中使用JPA作為數(shù)據(jù)持久化框架
這篇文章主要介紹了SpringBoot中使用JPA作為數(shù)據(jù)持久化框架的相關(guān)知識,本文通過示例代碼給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2023-03-03詳解Java中多線程異常捕獲Runnable的實(shí)現(xiàn)
這篇文章主要介紹了詳解Java中多線程異常捕獲Runnable的實(shí)現(xiàn)的相關(guān)資料,希望通過本文能幫助到大家,讓大家理解掌握這樣的知識,需要的朋友可以參考下2017-10-10bootstrap實(shí)現(xiàn)多個(gè)下拉框同時(shí)搜索的實(shí)例
下面小編就為大家?guī)硪黄猙ootstrap實(shí)現(xiàn)多個(gè)下拉框同時(shí)搜索的實(shí)例。小編覺得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2017-07-07SpringBoot前后端接口對接常見錯(cuò)誤小結(jié)
SpringBoot前后端接口對接工作時(shí),經(jīng)常遇到請求500,400等問題,本文主要介紹了SpringBoot前后端接口對接常見錯(cuò)誤小結(jié),感興趣的可以了解一下2022-01-01全面解析SpringBoot自動配置的實(shí)現(xiàn)原理
這篇文章主要介紹了全面解析SpringBoot自動配置的實(shí)現(xiàn)原理的相關(guān)資料,需要的朋友可以參考下2017-05-05