This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

group list elements based on an element

Ahsan Bagwan
Ranch Hand
Posts: 252
Java MySQL Database Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've some code below as that I use for querying the db and obtain that in my jsp file ,

The list returned looks something like [prefix1, no1, head1, amt1, prefix2, no2, head2, amt2,]. I'm trying to make a receipt in jsp on the lines of

prefix1/no1 amt1
prefix2/no2 amt 2
prefix3/no3 amt3

So I want to group all records by head column in the receipt - jsp file. How do I go about this? Any help completely appreciated. Please excuse my English.
System.out.println("cash list: "+payincash);
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic