I am trying to map a complex object which contains a list of complex objects.
But after mapping (no errors) the List of this complex objects is empty.
Probably I need to add an annotation or something else, any ideas or suggestions?
@RequestMapping(value = "/newTrip", method = RequestMethod.POST)
@ResponseBody
public Trip create(@Valid Trip trip,
BindingResult bindingResult, Model uiModel, HttpServletRequest httpServletRequest) {
if (bindingResult.hasErrors()) {
populateEditForm(uiModel, trip);
return null;
}
if(trip.getWaypoints() == null || trip.getWaypoints().isEmpty()){
throw new IllegalArgumentException();
}
return TripBL.createTrip(trip);
}