• Post Reply Bookmark Topic Watch Topic
  • New Topic

table on JSP page from java list  RSS feed

 
Nomi Malo
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I have a list of objects with each object in it having three properties : date, task, count (no of times the given task was completed on this date).

Some sample data would look like this:
22-09-2008, task_A, 5
22-09-2009, task_B, 3
23-09-2009, task A, 18
23-09-2009, task C, 12
.........

On my jsp i have this list available but I want to create a simple table with dates as column headers & and activities as row hearders. So the above sample data should look like:
Date task_A task_B task_C
22-09-2009 5 3 0
23-09-2009 18 12


Please suggest some solution. Thanks
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You simply loop over all beans and write the header row, then loop again and write the following rows.
 
Nomi Malo
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Janisch, I am not quite sure what exactly are you suggesting and how that would give me the required results. Please note that the required format has no dates or activities repeating in it. Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66158
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where's your code?
 
Nomi Malo
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bibeault, for privacy reason, I can't provide the actual code here. But I think that given information is enough to understand the scenario. As i mentioned earlier, a list of objects with each object having three properties, when you iterate through the list it gives you the results in this format:

22-09-2008, task_A, 5
22-09-2009, task_B, 3
23-09-2009, task A, 18
23-09-2009, task C, 12

But on my jsp page, i want to use this same list to make a proper table with the following format:

Date task_A task_B task_C
22-09-2009 5 3 0
23-09-2009 18 0 12

Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66158
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What could be proprietary about a set of <c:forEach> tags? Without code, it's doubtful we can help you.

Write up a similar example that shows your issue if you're worried about privacy.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!