Gson gson = new Gson();
Map<String,Object> map = new HashMap<String,Object>();
用的是这个
Map<String,Object> map = new HashMap<String,Object>();
用的是这个
解决方案 »
- 求查询条件的js实现思路
- java 调用 wsdl 的问题
- 新浪微博这种小窗口是怎么实现的?
- tomcat6.0和eclipse3.4怎么配置???
- 新手:tomcat5.5.17为何bin目录下没有shutdown.bat
- 如何将连接池配置在web.xml里 不涉及 conf\server.xml ?
- 如何通过java向文件中写中文!! 急
- 为什么有时候是使用PrintWriter 而不使用BufferedWriter ,有什么区别吗?
- 请问如何实现模式窗口,就是当打开子窗口主窗口不能操作,除非关闭子窗口,如果有这样的网页也行
- 救命啊, linux 下java访问mysql……
- session共享问题,用ServletContext做的,出了问题,大神帮忙看看啊!
- 系统找不到指定的路径
JSONArray data=dataJson.getJSONArray();
JSONObject info=data.getJSONObject(0);
String ent_name =info.getString("ent_name ");
Gson gson = new Gson();
List<类名> ps = gson.fromJson(string, new TypeToken<List<类名>>(){}.getType());ps.get();这个方法就行了。
有没有办法 用Gson 的,不用这个
Gson gs = new Gson();
Map<String,String> map = gs.fromJson(str, Map.class);
System.out.println(map.get("ent_name"));
String js = "{\"ent_name\":\"hhhhhhhhhhhhhhhhh\",\"ent_naming\":\"dd\",\"ent_naming_unit\":\"fff\",\"ent_escription\":\"赛事简介\"}";
JSONObject jo = JSON.parseObject(js);
System.out.println(jo.get("ent_naming"));
System.out.println("ent_escription");输出:
dd
ent_escription