【发布时间】:2015-11-05 12:14:58
【问题描述】:
我有一个 bean AgreegateBean,我将其用作传输对象。 bean 的类定义为 -
Class AgreegateBean {
private SomeOtherBean bean;
private List<Person> someList;
// getters and setters
}
我在带有 ModelAttribute 注释的 spring 控制器中使用这个 bean。对于 JSP,我有 JSTL。我已经用这样的字段填充了 JSP。
<input type="text" name="someList[0].name" />
<input type="text" name="someList[0].surName" />
当我提交表单时,我收到 java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 .
org.springframework.beans.InvalidPropertyException: Invalid property 'someList[0]' of bean class [com.form.bean.AgreegateBean]: Index of out of bounds in property path 'someList[0]'; nested exception is java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
【问题讨论】:
标签: java spring jsp spring-mvc