Consider a simple POJO Java Object:
class MyObj {
String a, b;
Integer c;
}
My application executes a Struts action and sets a Collection of these on the Http Request:
request.setAttribute("myObjects", getCollectionOfMyObj());
The action then forwards to a JSP page, and this is where my questions centres:
What is the simplest way I can bind this collection into a grid, such that is renders a table with three columns (a, b, c) and one row per object in the passed collection. A key characteristic I require, is that I can add a new field to the Java object and it requires no (or minimal) changes to the UI code, i.e. the object is being introspected and displayed so that I don't have D-R-Y violations in the UI?
How can I make the grid editable, so that any changes to a row are reflected back into a new (or the existing) Collection of Java objects in the request for use by other Actions (e.g. to persist the changes)?
Many thanks in advance for your help, please let me know if you need further clarification.
Arun