所以我有一个输入Json数据 -
[
{
"Id": "30B05CEC6808F81C7A8B",
"eventType" :"TestEventType"
}
]
包装类 -
public class CancelSeatEventDtoWrapper {
List<CancelSeatEventDto> cancelSeatDtoList;
public List<CancelSeatEventDto> getCancelSeatDtoList() {
return cancelSeatDtoList;
}
public void setCancelSeatDtoList(List<CancelSeatEventDto> cancelSeatDtoList) {
this.cancelSeatDtoList = cancelSeatDtoList;
}
}
和POJO
public class CancelSeatEventDto {
private String eventType, Id;
public String getEventType() {
return eventType;
}
public void setEventType(String eventType) {
this.eventType = eventType;
}
public String getId() {
return Id;
}
public void setId(String Id) {
this.Id = Id;
}
}
在Spring控制器中,其中一个方法有 -
@RequestMapping(value = "/teams/id.do", method = RequestMethod.DELETE)
@ResponseBody
public String deleteId(@RequestBody CancelSeatEventDtoWrapper jsonValue)
运行后,我收到400 Bad Request错误。 任何想法都错了吗?