Apr 23rd, 2012, 12:20 PM
generate generic object with JSP or JSTL ?
I'd like to have a page that displays a list of objects- the object type to be determined at runtime.
I'm wondering if there is a way in JSTL or JSP to get each of the object's members generically, and iterate through the list displaying the values.
For example, if I have a Person object with an ID, Name, Address, Phone. And I have a Purchase object with an ID, Name, Price, Supplier
I want the page to load a list of Persons, or a list of Purchases (or any other type of object). But I would like to only have to create one HTML(jsp) page, iterate through the objects, and for each object, write each column value to the line.
Hoping someone might know a way to do this.