Struts2: Updating the values of a “List Of Objects” inside a Map

According to your latest update. If you are using TreeMap Struts2 cannot correctly determine type of elements inside it. Change declaration of testTreeMap from TreeMap to Map.

private Map<String,ObjectCList> testTreeMap = new TreeMap<String,ObjectCList>();

Or annotate testTreeMap with com.opensymphony.xwork2.util.Element annotation to tell Struts2 what type are elements inside map.

@Element(value = ObjectCList.class)
private TreeMap<String,ObjectCList> testTreeMap = new TreeMap<String,ObjectCList>();

Leave a Comment