I have a form in spring mvc 2 with the class of commands "Class1"
I want to associate class 3 elements with an input field in this form. Below are my classes.
I am iterating / snapping to class 2 elements in a JSP other than a map like this
<c:forEach var="item" items="${class1.class2List}" varStatus="itemsRow"> <form:input path="class2List[${itemsRow.index}].anyElement2" /> .......... </c:forEach>
My classes look like
Class1 List<Class2> class2List; String anyElement1; Class2 Map<String, Class3> class2Map; String anyElement2; Class3 Map<String, Class3> class3Map; String nameToGet; String anyElement3;
How to bind anyElement3 inside class3Map . Is it possible?
Edited for the first answer
Caused by: org.springframework.beans.NullValueInNestedPathException: Invalid property 'class2List[0].class2Map[0]' of bean class [com.Class1]: Could not instantiate property type [com.Class3] to auto-grow nested property path: java.lang.InstantiationException: com.Class3 at org.springframework.beans.BeanWrapperImpl.newValue(BeanWrapperImpl.java:641)
Muhammad Imran Tariq
source share