I have a database where I need to display as many rows in a HTML table as the maximum value in one of the columns in the corresponding table in a database.
For example, consider this bunch of data stored in the database:
1 | 1 | abc
1 | 2 | def
1 | 3 | ghi
2 | 1 | jkl
2 | 2 | mno
2 | 3 | pqr
Now, I need to create two rows (because the maximum value in the first column is 2) in the HTML table where I want to display this data. However, for every row which has the value 1 or 2, I need to create three columns (because there are three entries with the values 1 and 2 in the first column).
So the result (i.e. HTML table) rendered on the
JSP page should be something like (consider that I'm displaying the last column):
abc | def | ghi
jkl | mno | pqr
How do I implement this in JSP, considering that I'm following an MVC architecture (no special frameworks like
Struts and the like though)?
Thanks all for your inputs.
[ January 08, 2008: Message edited by: Sridhar Venkataraman ]
[ January 08, 2008: Message edited by: David O'Meara ]
[ January 08, 2008: Message edited by: Bear Bibeault ]