웹 개발

convert object to jsonobject (오브젝트를 JSON 형식으로 변환)

노루아부지 2019. 8. 23. 23:44
Map<String, Object> map = new HashMap<String, Object>();
map.put("PARTNER_NO"    , "0002485000"  );
map.put("RSRVCH_DIV"     , "91"           );
map.put("RSRV_NO"        , BARCODE    );
map.put("RSRV_STAT"     , "2"             ); 
 
// 1
JSONSerializer.toJSON(map);  // net.sf.json.JSONSerializer

// 2
JSONObject.fromObject(map);  // net.sf.json.JSONObject

 

728x90
loading