我正在向 REST 服务发布 JSON 请求。服务生成一个 json 列表(将 bean 列表对象转换为 JSON)。但它不包含在客户端解析此列表的密钥。我可以在客户端解析没有密钥的 json 列表吗,或者如何将密钥分配给该列表。
@RequestMapping(value="/getScheduleTrip", method=RequestMethod.POST, consumes="application/json" )
public @ResponseBody List<ResponseParametersOfRest> getScheduleTrip(@org.springframework.web.bind.annotation.RequestBody RequestParametersOfRest requestRest) {
List<ResponseParametersOfRest> responseRest = null;
try{
System.out.println("hello");
responseRest = serviceScheduledTripJDBCTemplate.getTripDetails(requestRest);
}catch(Exception ee){
ee.printStackTrace();
}
return responseRest;
}
输出是
[{"companyID":8,"deviceID":18,"vehicleID":18,"personnelID":172,"startCity":"Jaipur","startState":"ND","startDate":"2013-08-14","startTime":"10:55:00","endCity":"ajmer","endState":"CM","endDate":"2013-08-05","endTime":"10:55:00","manifestNo":"7568956","initialCargoWeight":"0","yardLocation":"","loadStatus":false,"scheduledTripUserID":42,"instructions":null,"scheduledTripStatus":false,"receivedDateTime":"2013-08-05 10:58:33.0","serverScheduledTripID":42,"deleteStatus":false,"errorCode":0}]