반응형

테스트 데이터 구조
{
"response":{
"header":{"resultCode":"00","resultMsg":"NORMAL SERVICE."}
,"body":{"items":
{
"item":[
{"airline":"아시아나항공","airport":"마닐라","airportCode":"MNL","carousel":19,"cityCode":"MNL","elapsetime":"0316","estimatedDateTime":"0359","exitnumber":"E","flightId":"OZ704","gatenumber":32,"remark":"도착","scheduleDateTime":"0500","terminalId":"P01"}
,{"airline":"대한항공","airport":"마닐라","airportCode":"MNL","carousel":10,"cityCode":"MNL","elapsetime":"0322","estimatedDateTime":"0410","exitnumber":"B","flightId":"KE624","gatenumber":251,"remark":"도착","scheduleDateTime":"0500","terminalId":"P03"}
]
}
}
}
}
item 영역만 가져오고 싶을땐
JSONObject json = new JSONObject(받아올 스트링 데이타.. );
JSONObject newjson = json.getJSONObject("response").getJSONObject("body").getJSONObject("items");
끝
반응형
'BackEnd > ::: JAVA :::' 카테고리의 다른 글
| spring 마지막날 ,lastday , 막날 계산 , 날짜 계산 (0) | 2022.08.02 |
|---|---|
| 스웨거 swagger ui 오류 (0) | 2021.08.20 |
| JAVA 트리(tree) 이해하기 1 (0) | 2021.02.05 |
| JAVA 공백제거 trim 으로 안되어서 (0) | 2020.11.10 |
| 공공 data api HttpURLConnection 500 애러 발생 해결 (0) | 2020.10.21 |
| java 시스템 변수 읽어오기 ( System.getenv() Examples) 정보 (0) | 2020.01.30 |
| java spring(스프링) xml mashalling (마샬링) 2 (0) | 2020.01.29 |
| 마이바티스 IN 처리 (Mybatis IN ) (0) | 2019.08.09 |
