Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring mvc Spring MVC接口绑定集合_Spring Mvc - Fatal编程技术网

Spring mvc Spring MVC接口绑定集合

Spring mvc Spring MVC接口绑定集合,spring-mvc,Spring Mvc,我尝试将接口列表绑定到控制器,并能够以JSP形式编辑它们。 我创建了如下列表: private List<MyInterface> list = new AutoPopulatingList<MyInterface>(MyInterface.class); private List=new AutoPopulatingList(MyInterface.class); 我可以填充列表并将其发送到JSP,在JSP上我使用spring表单标记,如下所示: <c:for

我尝试将接口列表绑定到控制器,并能够以JSP形式编辑它们。 我创建了如下列表:

private List<MyInterface> list = new AutoPopulatingList<MyInterface>(MyInterface.class);
private List=new AutoPopulatingList(MyInterface.class);
我可以填充列表并将其发送到JSP,在JSP上我使用spring表单标记,如下所示:

<c:forEach items="${list}" var="entry" varStatus="i">
    <form:input path="list[${i.index]" />
</c:forEach>

到目前为止一切都很好,我的问题是当我提交表格。 我的列表中的每个元素都可以是接口的不同实现,接口确实公开了类型属性

我想要一种方法,在创建列表中元素的实例时告诉Spring,以查看适当的类型字段并创建正确的实现