日期:2014-05-16 浏览次数:20381 次
String gra = JSONUtils.toJSON(getParam("grantee"));//获取json字符串
if(StringUtils.isNotEmpty(gra)){//验证是否为空 List list = JSONUtils.jsonStringToList(gra);//将json字符串转换成list数组 for (Iterator iterator = list.iterator(); iterator.hasNext();) {//循环遍历list Map row = (Map) iterator.next();//转换成map对象 Grantee gt = new Grantee();//定义bean gt.setAccessType("ALLOW"); gt.setDistinguishedName(row.get("distinguishedName").toString().trim()); granteeList.add(gt);//将bean对象添加到list } }
?