• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Iteration of List in JSP

 
M Zahid
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got a List through criteria with following code. I am using struts and hibernate technologies in netBean6.8. The following method has been coded in a helper class.



============================================
Now I want to iterate the above list in jsp. Kindly guide for this or any other possible method to iterate this list in JSP.

 
Mohamed Sanaulla
Saloon Keeper
Posts: 3159
33
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For iterating in JSP you can have a look at the EL syntax or the Tag library should have support for this. Am not able to recall the exact syntax.
 
M Zahid
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
coding in the action class is appended below



Libraries and coding in the jsp is appended below



The exception occurs that no collection found
 
Devaka Cooray
ExamLab Creator
Marshal
Pie
Posts: 4495
267
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Zahid, I added code tags for your posts. Please don't forget to UseCodeTags in future.
I'm moving to Struts forum...
 
Shankar Tanikella
Ranch Hand
Posts: 329
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure, but try arrayList once instead of List and see if it is working. If it doesnt work just post the form bean content for this list, bean definition in struts config and exception stacktrace (few lines more)
 
Stefan Evans
Bartender
Posts: 1743
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rather than logic:iterate I would prefer the JSTL forEach tag over the list attribute.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic