码迷,mamicode.com
首页 >  
搜索关键字:jsonobject    ( 880个结果
get请求
上代码干货 import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import org.apache.http.HttpEntity; import org.apache.http.client.metho ...
分类:其他好文   时间:2020-01-01 23:29:08    阅读次数:62
Java中使用JSONTokener判断接口返回字符串是JSONObject还是JSONArray
今天在接口对接中,遇到一个问题,对方接口返回的JSONString,类型不确定,所以需要先做判断再进行处理。查阅资料后使用JSONTokener可进行处理,特此记录。 1 String ret = orderapi.invoke(apiparam.toString()); 2 3 Object ob ...
分类:编程语言   时间:2020-01-01 00:02:59    阅读次数:165
文件上传
1 package com.oracle.upload; 2 3 import com.google.gson.Gson; 4 import com.google.gson.JsonObject; 5 import com.oracle.domain.ResponseUpload; 6 import ...
分类:Web程序   时间:2019-12-31 01:36:17    阅读次数:107
一个基于mongoDB的 MongoTemplate 的基本操作类
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.mongodb.client.ListIndexesIterable; import com.mongodb.client.mod... ...
分类:数据库   时间:2019-12-30 14:11:39    阅读次数:783
XStream类对象把List<javaBean>()转成json数据
【省市联动】 Servlet端: XStream把list转成json数据 //JSONArray-->变成数组/集合[] //JSONObject-->变成简单的数据{name:ayee, pid:1} JSONArray jsonArray = JSONArray.fromObject(list ...
分类:编程语言   时间:2019-12-28 20:55:16    阅读次数:83
java ObjectMapper json 与对象的相互转换
1 json string 转 JSONObject try { JSONObject jsonObject = new JSONObject("{\"phonetype\":\"N95\",\"cat\":\"WP\"}"); }catch (JSONException err){ Log.d(" ...
分类:移动开发   时间:2019-12-28 19:15:18    阅读次数:261
springBoot使用aop添加处理rest请求 打印请求时间 和请求参数
贴上aop配置 import com.alibaba.fastjson.JSONObject; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.aspect ...
分类:编程语言   时间:2019-12-27 11:20:53    阅读次数:286
(二)fastJson和其他类型转换
//String to Json String str = "{\"语文\":\"88\",\"数学\":\"78\",\"计算机\":\"99\"}"; JSONObject jsonObject; jsonObject = JSONObject.parseObject(str); System. ...
分类:Web程序   时间:2019-12-24 20:19:45    阅读次数:93
fastjson中toString与toJSONString的差别
查看JSONObject源码: @Override public String toString() { return toJSONString(); } public String toJSONString() { SerializeWriter out = new SerializeWriter ...
分类:Web程序   时间:2019-12-24 15:44:37    阅读次数:308
FastJson中JSONObject用法及常用方法总结
最近一直有用到解析各种数据,主要是用FastJson进行数据解析,其中一个重要的类为JSONObject,今天有时间,所以进行总结一下: JSONobject是FastJson提供的对象,在api中是用一个私有的常量map进行封装的,实际就是一个map,只不过FastJson对其进行了封装, 添加了 ...
分类:Web程序   时间:2019-12-24 13:37:03    阅读次数:98
880条   上一页 1 ... 5 6 7 8 9 ... 88 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!