• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

group list elements based on an element

 
Ranch Hand
Posts: 254
1
MySQL Database Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

head1
-------------------
prefix1/no1 amt1
-------------------
prefix2/no2 amt 2
-------------------
--------------------
head3
-------------------
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);
 
reply
    Bookmark Topic Watch Topic
  • New Topic