This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Whats wrong with this code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Whats wrong with this code" Watch "Whats wrong with this code" New topic
Author

Whats wrong with this code

raghu dubey
Ranch Hand

Joined: Jul 05, 2007
Posts: 72
Hi All,

Below is the code for a Model class that gets called from my controller servlet. The problem is that the List<List<String>> object does not get populated with the column details. I just get a List of lists where each list is not containing the row data and is just blank. The for loop at the end just prints the blank data. Please help:

Using tomcat 5.5 and JDK 5.

====


===========

[ Edited to use code tags - Paul Sturrock ]
[ October 06, 2008: Message edited by: Paul Sturrock ]

Thanks,<br />Raghu.<br /> <br />SCJP 5, SCWCD 1.4, NCFM
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

You're reusing the same List instance each time and wiping it clean.
You need to create a new instance each time otherwise everyone will end up with a reference to the same List<String>, which will be empty.
raghu dubey
Ranch Hand

Joined: Jul 05, 2007
Posts: 72
Thanks David
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Whats wrong with this code
 
Similar Threads
readObject() eat memory !!!
hibernate update in single transcation
Issue Req Storing Result Set Data in a XML File
jxls problem
Undefined attribute name Items compilation error using jstl