JSON(对象数组,HashMap)
来源:互联网 发布:soa mlc 知乎 编辑:程序博客网 时间:2024/06/01 09:25
//跟对象有关用对象数组传,跟对象无关用HashMap
ImplOrderDao orderDao=newImplOrderDao();try {orderDao.insertOrder(order);HashMap<String,String> map=new HashMap<>();map.put("status","success");map.put("orderid",order.getId());map.put("totalprice",totalprice);Stringjson=JSONObject.fromObject(map).toString();response.getWriter().write(json);} catch(SQLException e) {//TODO Auto-generated catch blocke.printStackTrace();}
对象数组
Parameter[] parArr = new Parameter[list.size()-1]; for(int i = 0; i < list.size(); i++) {Parameterparameter = list.get(i);System.out.println(parameter);Dateformat = dateFormat.parse(parameter.getInsertTime());Stringtime = dateFormat.format(format);// format函数是把日期转换成字符串parameter.setInsertTime(time);System.out.println(parameter);parArr[i]= parameter;}Stringjson = JSONArray.fromObject(parameter).toString();response.getWriter().write(json);
0 0
- JSON(对象数组,HashMap)
- json数组 json对象
- json 数组 转json对象。
- Json对象转json数组
- 对象数组转JSON
- json数组与对象
- json 数组 对象
- Json解析数组对象
- 解析json数组对象
- 解析Json对象数组
- 浅谈json,对象,数组
- JSON对象和数组
- JSON对象和数组
- json转对象数组
- json对象和数组对象
- JSon对象、JSon数组和JSon字符串。
- JSON字符串,JSON对象,JSON数组
- json数组对象和对象数组、json对象长度
- Android中Serializable接口的应用
- 经典动态规划2-----Map记录
- ZOJ 2760 How Many Shortest Path 网络最大流
- 【Sonar】Sonar实战篇
- MySQL
- JSON(对象数组,HashMap)
- php版本
- RecyclerView和EditText焦点冲突和输入法软键盘把布局顶出屏幕之外的解决
- HDU-5102-The K-th Distance【思维】【好题】
- Sass mixin
- DES(ecb)加密
- [BZOJ2788][Poi2012]Festival(差分约束+floyed+tarjan)
- Python性能分析
- C语言下程序的堆栈调用(详细,图示)