File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Iteration of List in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Iteration of List in JSP" Watch "Iteration of List in JSP" New topic

Iteration of List in JSP

M Zahid

Joined: Feb 05, 2011
Posts: 3
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

Joined: Sep 08, 2007
Posts: 3152

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.

Mohamed Sanaulla | My Blog
M Zahid

Joined: Feb 05, 2011
Posts: 3
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

Joined: Jul 29, 2008
Posts: 3927

Zahid, I added code tags for your posts. Please don't forget to UseCodeTags in future.
I'm moving to Struts forum...

Author of ExamLab ExamLab - a free SCJP / OCPJP exam simulator
What would SCJP exam questions look like? -- Home -- Twitter -- How to Ask a Question
Shankar Tanikella
Ranch Hand

Joined: Jan 30, 2011
Posts: 329

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)

Have Fun with Java
little,little.. little by little makes a lot..
Stefan Evans

Joined: Jul 06, 2005
Posts: 1580
Rather than logic:iterate I would prefer the JSTL forEach tag over the list attribute.
I agree. Here's the link:
subject: Iteration of List in JSP
It's not a secret anymore!