{
"userList" : {
"user" : [{
"Id" : "33",
"userId" : "raji2",
"customerId" : "35",
"username" : "raji2",
"status" : "1",
"locked" : "0",
"customAttributes" : "{\"uiPageId\":\"\",\"uiPageName\":\"\",\"uiPageViewMode\":\"Normal\"}",
"addressList" : {
"address" : ""
},
"contactList" : {
"contact" : {
"contactno" : "+919526346097",
"email" : "[email protected]"
}
},
"roleList" : {
"roleId" : "7"
},
"privilegeList" : {
"privilegeId" : ["1", "10", "11", "12", "13", "14", "15", "16", "17", "23", "24", "25", "26", "27"]
},
"entityList" : {
"entityId" : ""
}
}, {
"Id" : "34",
"userId" : "raji3",
"customerId" : "35",
"username" : "raji3",
"status" : "1",
"locked" : "0",
"customAttributes" : "{\"uiPageId\":\"\",\"uiPageName\":\"\",\"uiPageViewMode\":\"Normal\"}",
"addressList" : {
"address" : ""
},
"contactList" : {
"contact" : {
"contactno" : "+919526346097",
"email" : "[email protected]"
}
},
"roleList" : {
"roleId" : "7"
},
"privilegeList" : {
"privilegeId" : ["1", "10", "11", "12", "13", "14", "15", "16", "17", "23", "24", "25", "26", "27"]
},
"entityList" : {
"entityId" : ""
}
}
]
}
}
나는이 아래의 샘플을 사용하여 이메일 또는 고객 ID를을 위해 노력 구문 분석하려고
는, 데이터가 코드, 널 (null)로오고있다 내가 시도 니펫을하는 것입니다 :JSONObject obj = (JSONObject) new JSONParser().parse(data);
JSONObject jsonObject = (JSONObject) obj;
System.out.println(jsonObject);
String x=(String) jsonObject.get("customerId");
System.out.println("Check Data"+x);
나는 간단한 JSON 라이브러리를 사용했다. null 응답이 표시됩니다.
음을,' "customAttributes는"의'_string_로 포함 된 JSON 개체는? 응? – fge
어떤 특정 라이브러리를 사용하고 있습니까? 어떤 고객을 검색하려고합니까? 모두들? – Jahed
@Jahed org.json.simple, 모두 –