我正在尝试将此 JSON 传递给 Springs 控制器:
{"orderList":["IS_cb-A1-3","IS_cb-A1-4","IS_cb-A1-1","IS_cb-A1-2","IS_cb-A1-3"]}
这是方法声明:
public @ResponseBody JsonResponse orderCertificates(@ModelAttribute CertificateRequest certificateOrder, BindingResult result )
这是豆子:
public class CertificateRequest {
private String[] orderList = null;
private List<String> mbsResponse = new ArrayList<String>();
public String[] getOrderList() {
return orderList;
}
public void setOrderList(String[] orderList) {
this.orderList = orderList;
}
public List<String> getMbsResponse() {
return mbsResponse;
}
public void setMbsResponse(List<String> mbsResponse) {
this.mbsResponse = mbsResponse;
}
}
我不知道如何构建这个 bean(它不起作用)以便我可以访问这个数组。任何帮助,将不胜感激。