There are way to bind List object by using spring modelAttribute? Actually, I know that it can be done by using Wrapper class having list member variable. like this
Dto :
public class SampleDto {
private List<SubSampleDto> sampleList;
}
Controller :
@RequestMapping(value = "/sample/insert.ajax")
public String set(@ModelAttribute("sampleDto") SampleDto dto) {
...
}
But, I want to know the way not to use wrapper class. Thanks
You could bind it like,
@ModelAttribute("sampleList")
public List<SubSampleDto> getAll() {
return subSampleDtoService.getAll(); //or something to get SubSampleDto list
}
if i understood you correctly
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.