File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Whats wrong with this code

 
raghu dubey
Ranch Hand
Posts: 72
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 72
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks David
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic