json转为java的vo对象
String str = "[{'name':'hello',age:'21'},{'name':'hello2',age:'22'},{'name':'hello3',age:'23'}]";JSONArray jsonArray = JSONArray.fromObject(str);List list = new ArrayList();for ( int i = 0 ; i<jsonArray.size(); i++){ JSONObject jsonObject = jsonArray.getJSONObject(i);TestUserVo vo = (testUserVo) JSONObject.toBean(jsonObject,TestUserVo.class); System.out.println(vo.getAge()); list.add(vo); } 1 楼 jimmycheng 2010-05-21 讨论个问题: