How to send list of Objects to View and back to Post method in controller

I think this link will help you set up what you are trying to do:

http://viralpatel.net/blogs/spring-mvc-multi-row-submit-java-list/

It looks like in your form you need to modify it to something like:

<form:form method="post" action="savePerson" modelAttribute="persons">
    <c:forEach var="person" items="${persons}" varStatus="status">
        <form:input path="person[${status.index}].FName" name="FName" id="FName" value="" />
        <form:input path="person[${status.index}].LName" name="LName" id="LName" value="" />
    </c:forEach>

This SO question has a pretty good example that might help you out too: List<Foo> as form backing object using spring 3 mvc, correct syntax?

Leave a Comment