Suppose my model field is a HashMap of Strings to ArrayList's of Strings.
HashMap<String,ArrayList<String>> map = new HashMap<String,ArrayList<String>>();
For field binding, I need to point to an i-th item of the ArrayList of a specific key in my JSP. How do I do it? Will this double-bracket notation work? Assume that 'key' and 'index' are known JSTL variables in my JSP.
<form:checkbox path="map[${key}][${index}]" />
What I'm essentially doing is, for a field value, store its path e.g.
map['testkey'][4]
which would point to
map.get("testkey").get(4);
That doesn't work:
org.springframework.beans.NullValueInNestedPathException: Invalid property 'map[TestKey][0]'
NOTE According to this (Binding a map of lists in Spring MVC), this will be a problem because sub-objects are not auto-growable, and I need to implement a LazyList or a growable list? An ArrayList by itself is growable for Spring MVC's forms, but when used as a sub-collection, it's not? Very tricky.