Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

nested forEach

 
Vinod Awar
Ranch Hand
Posts: 129
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hii all,

i want to display the result of a database query .In the servlet what i did is


and in the jsp i am trying to display them like this


But i can only see the columnnames. is there anything wrong in my nested forEach loop code

Thanks,
Vinod
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem isn't in your JSP.

You're only creating one "fields" object.
Move the declaration for your 'fields' object into the loop so a new one gets created for each row and try it again.



[BPSouther: fixed cut and paste error. Thanks Saif!]
[ March 15, 2007: Message edited by: Ben Souther ]
 
Muhammad Saifuddin
Ranch Hand
Posts: 1324
Android Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ben Souther:



how about Swapping the second line with first line I though it becomes with more clear picture.. ;)
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Saif uddin:


how about Swapping the second line with first line I though it becomes with more clear picture.. ;)


Fixed. Thanks
 
Vinod Awar
Ranch Hand
Posts: 129
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ben and saif
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic