File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes logic iterate doesnt show me correct data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "logic iterate doesnt show me correct data" Watch "logic iterate doesnt show me correct data" New topic
Author

logic iterate doesnt show me correct data

JoseDeJesus Arena
Greenhorn

Joined: Apr 24, 2011
Posts: 4

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??
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8935
    
    9

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.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
JoseDeJesus Arena
Greenhorn

Joined: Apr 24, 2011
Posts: 4

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

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: logic iterate doesnt show me correct data