• 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

logic iterate doesnt show me correct data

 
Greenhorn
Posts: 4
Android Eclipse IDE MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, everybody, I need your help, because I need to Iterate a List with strut´s logic:iterate tag, but I only getting the information of the last record of the query that I excecute before, for example the result of my sql query it´s something like this

1 1 1 1
2 2 2 2
3 3 3 3
4 4 4 4
5 5 5 5

When I excecute my code, the JSP only repetme five times the last record

5 5 5 5
5 5 5 5
5 5 5 5
5 5 5 5
5 5 5 5


here is a snippet of my code from my action class

Here I call a method named generarReportes, an here a snippet form my implementation

And finally in my JSP

So could you please help me to figured out whats wrong with my code??
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the JavaRanch.
Please UseCodeTags when you post code. It preserves the formatting and makes it easier to read.
As for your problem, you should ask yourself how many instances of serviciosVO should be in listaAgendados.
 
JoseDeJesus Arena
Greenhorn
Posts: 4
Android Eclipse IDE MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the advice Joe, and yes you are complete right because inside the while I just had a instance of my object, so every time execute that line just overwrite my instance, so what I did it was inside the while create a new instance of my object and it works fine

 
reply
    Bookmark Topic Watch Topic
  • New Topic