i'm generating an html table into a jsp file using struts2. i would like to change values contained into this arraylist, but the behaviour is not what i was expecting...
my flow: Action.java: generate an arraylist "struct" which contains "n" (for example 5) objects of type MyElem.
private ArrayList<MyElem> struct;
public void setStruct(...) {...}
public ArrayList<MyElem> getStruct() {...}
and the details of MyElem :
private String name;
private String type;
private int length;
private int precision;
private String usage;
private String init;
of course, all getters and setters are declared.
test.jsp :
<s:iterator value="struct" status="elemsStatus">
<tr>
<td><s:textfield name="struct.name" value="%{name}" theme="simple"/></td>
<td><s:textfield name="struct.type" value="%{type}" theme="simple"/></td>
<td><s:textfield name="struct.length" value="%{length}" theme="simple"/></td>
<td><s:textfield name="struct.precision" value="%{precision}" theme="simple"/></td>
<td><s:textfield name="struct.usage" value="%{usage}" theme="simple"/></td>
<td><s:textfield name="struct.init" value="%{init}" theme="simple"/></td>
</tr>
</s:iterator>
then back in Action.java when i iterate on struct, i don't have 5 objects MyElem, but 30 : one with a "name", one with a "type", and so on for every rows... in fact i would like to have into struct one object MyElem by rows in my html table.
Thanks you !