• 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

Retrieving data using iterate and eliminating duplicate values

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am executing 2 different sql queries in my action class, the first query retrieves values that are then used in the second query to retrieve related data. Here is my problem, the second query is retrieving from a comment table where there may be two or more rows of data. When this occurs, my jsp will show the same values for each row of comments found. I want to eliminate the duplicate displays and only display the comment. I am new to struts and am not sure how to do that. Here is my action class code looping through the results of the first query:

Here is the jsp code I am using to iterate:

The display is looks kind of like this:
a b c d e f g comment 1
a b c d e f g comment 2
a b c d e f g comment 3
I want it to look like this:
a b c d e f g comment 1
comment 2
comment 3
How do I get this result using the iterate?
[edit: moderator added code tags]
[ October 17, 2003: Message edited by: Junilu Lacar ]
 
Hey, check out my mega multi devastator cannon. It's wicked. It makes this tiny ad look weak:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic