我确实在json下面发布了包含
{"testListObject":[{"testText":"bbb","testDate":"02.01.2011 00:00:00.000"},{"testText":"aaa","testDate":"01.01.2011 00:00:00.000"}]}
在我的弹簧控制器中,我有
@RequestMapping(value = "/post/tester/", method = RequestMethod.POST)
public @ResponseBody String postItinerary(@ModelAttribute("testListObject") TestList testList) throws IOException {
System.out.println("1="+testList); //ok
System.out.println("2="+testList.childListObject); //print null
}
知道为什么我的 List childListObject 为 null 吗?
我的 pojo 如下所示
public class TestList (){
public List<ChildObject> childListObject;
//get and set
}
public class ChildObject(){
public String testText;
public String testDate;
//get and set
}