I'm trying to update a map using struts 2 form. Iterating over the map displays the key value pair correctly, but when I submit the form, map is not getting populated. Key is a string with characters like . and /. Here is an example:
Map<String, String> map = new HashMap<String, String>();
map.put("utilities.student_info.note", "note");
<s:iterator value="map" var="property" status="status">
<s:property value="%{key}"/>
<s:textarea name="map[%{key}]" value="%{value}" rows="5" cols="60"/>
</s:iterator>
I tried using quotes like this: name="map['%{key}']"
, but it still doesn't work.
I can see from the logs that the ParamsInterceptor
is setting the params correctly: map[utilities.student_info.note] => [note]
. But the map is empty on the action side.
If I use name="map[%{#attr.status.index}]"
, it populates the map, but the key is an index (map[0] => [note])
which is not right.
Any suggestions would be appreciated. Thanks.