首页 > 代码库 > java_method_下拉框成json

java_method_下拉框成json

List<String[]> proList=service.getUserList();

int nTotal=0;
String proJson="[";
proJson+="{\"userID\":\"\",\"loginID\":\"全部\"},";
if(proList!=null&&proList.size()>0){
nTotal=proList.size();
String[] strsProvince=null;
for (int i = 0; i < nTotal; i++) {
strsProvince=proList.get(i);
proJson+="{\"userID\":\""+StringUtils.isNull(strsProvince[0])+"\","
+"\"loginID\":\""+StringUtils.isNull(strsProvince[1])+"\"}";
if(i<(nTotal-1)){
proJson+=",";
}
}
}
proJson+="]";

java_method_下拉框成json