I am working on a project where I need to send data from a JSP page to an action class in a form List, I install List<Object>from an action class the first time I map to a JSP page, when I perform an action to save details. In action, I get the values List<Object>as a Cartesian product for each value.
eg. If there is a list of 3 objects (with 4 members) passing in the JSP, when it returns to action, it generates 12 objects with different JSP values.
The image shows a demo user interface, this is not a table, but each row represents a list object

in an action class
List<Pojo> PojoList = new ArrayList<Pojo>();
Can someone suggest me which approach I should use, this is a new scenario for me, I also tried some example from the Internet, but could not, I also iterate over the list in JSP, but it gave me an error. (not quite an error but it does not give fields on the JSP);
In JSP:
<c:forEach var="pojo" items="${pojoList}">
<s:textarea name="pojo.field1">
<s:textarea name="pojo.field2">
<s:textarea name="pojo.field3">
<s:textarea name="pojo.field4">
</c:forEach>
Return In Action class method (it outputs 12 objects)
try {
System.out.println("List : "+pojoList);
for (Iterator<Pojo> iterator = pojoList.iterator(); iterator.hasNext();) {
Pojo pojo = (Pojo) iterator.next();
System.out.println("\n MB : "+pojo);
}
} catch (Exception e) {
e.printStackTrace();
}
Please suggest me what will be wrong.
source
share