Part 1: There is an object (ObjectA) that has another object (ObjectB). Object B. has a hash map. This hash file has a string as a key, and another "ObjectC" object as a value. This hash is displayed in jsp using the s: iterator and s: text field, and it displays correctly. that is, the "values" inside the s: text field are correct, but the "name" is not. Now the problem occurs when changing the text field. How do we commit changed values ββinside an ObjectC in an action class?
public class ObjectA implements Serializable { private Integer attr1; private List<ObjectB> objB;
public class ObjectB implements Serializable { private Integer attr11; private Map<String,ObjectC> myMap;
public class ObjectC implements Serializable { private Integer attr111; public String attr112;
Jsp code:
<s:iterator value="#objB.myMap" var="fieldMap" status="fieldStatus"> <li><label><s:property value="#fieldMap.key"/></label><span> <s:textfield name="<NOT SURE>" value="%{#fieldMap.value.attr12}" /></span></li> </s:iterator>
source share