摘要: public static void main(String[] args) { ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[] {"applicationContex... 阅读全文
posted @ 2015-08-12 15:17 ihanliu 阅读(239) 评论(0) 推荐(0)
摘要: public static void main(String[] args) { //json格式的字符串 String json = "{'source':'95','custelno':'','pasmid':'CBC8D8A800000001'," + "'userid':'','i... 阅读全文
posted @ 2015-08-12 14:48 ihanliu 阅读(245) 评论(0) 推荐(0)
摘要: 如何将数组转化为 json 串?下面的例子中我们示例如何将一个数据转换成 json 串,并使用 Gson.toJson() 方法将数组序列化为 JSON,以及Gson.fromJson() 方法将 JSON 串反序列化为 java 数组。import com.google.gson.Gson;pub... 阅读全文
posted @ 2015-08-12 14:43 ihanliu 阅读(229) 评论(0) 推荐(0)
摘要: Json-lib可以将Java对象转成json格式的字符串,也可以将Java对象转换成xml格式的文档,同样可以将json字符串转换成Java对象或是将xml字符串转换成Java对象。一、 准备工作1、 首先要去官方下载json-lib工具包下载地址:http://sourceforge.net/p... 阅读全文
posted @ 2015-08-12 14:25 ihanliu 阅读(265) 评论(0) 推荐(0)
摘要: Fastjson介绍Fastjson是一个Java语言编写的JSON处理器。1、遵循http://json.org标准,为其官方网站收录的参考实现之一。2、功能qiang打,支持JDK的各种类型,包括基本的JavaBean、Collection、Map、Date、Enum、泛型。3、无依赖,不需要例... 阅读全文
posted @ 2015-08-12 13:57 ihanliu 阅读(233) 评论(0) 推荐(0)