你看使用fastjson这个jar包中的功能应该能满足你的要求,需要知道该key在json中所在位置,测试代码如下
public static void main(String args[]){ String jsonStr = "{\"trade_fullinfo_get_response\":{\"trade\":{\"orders\":{\"order\":[{\"adjust_fee\":\"0.00\",\"buyer_rate\":false,\"cid\":50012137,\"discount_fee\":\"0.00\",\"is_oversold\":false,\"num\":1,\"num_iid\":2100534490030,\"oid\":193683735371084,\"order_from\":\"TAOBAO\",\"outer_iid\":\"2100534490030\",\"part_mjz_discount\":\"0.00\",\"payment\":\"10.00\",\"pic_path\":\"!!0-item_pic.jpg\",\"price\":\"10.00\",\"refund_status\":\"NO_REFUND\",\"seller_rate\":false,\"seller_type\":\"C\",\"sku_id\":\"31062026048\",\"sku_properties_name\":\"套餐种类:官方标配;颜色分类:天蓝色\",\"snapshot_url\":\"d:193683735371084_1\",\"status\":\"WAIT_SELLER_SEND_GOODS\",\"title\":\"沙箱测试test_yj\",\"total_fee\":\"10.00\"}]},\"seller_nick\":\"sandbox_c_20\",\"tid\":193683735371084},\"request_id\":\"16qgoyoh8zfz1\"}}"; JSONObject json = JSONObject.parseObject(jsonStr); Object trade_fullinfo_get_response = json.get("trade_fullinfo_get_response"); System.out.println(trade_fullinfo_get_response); if(trade_fullinfo_get_response!=null){ JSONObject respJson = JSONObject.parseObject(trade_fullinfo_get_response.toString()); System.out.println(respJson.get("trade")); System.out.println(respJson.get("request_id")); } }