• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

Iterating using forEach

 
Ranch Hand
Posts: 763
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi i have list of objects in the moduleList, the size of the list is 8 but i am wondering how do i iterate through this loop.

how does forEach work ?

in the code bellow i have hard coded the index 1,

I don't want to use scriptlets in my jsp.



Can anybody help me out with this...
 
Jigar Naik
Ranch Hand
Posts: 763
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok i was missing many steps.

now i have inclided jstl 1.2.jar and standard.jar in my class path.

added entry in web.xml

added entry in jsp as bellow

<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>

and try to access the data. as bellow


i m getting the result but its wrong. there are 8 rows in my table but its printing only the last row 8 times.

what may be the issue.

i am new to JSTL.

please help me it.
 
Ranch Hand
Posts: 300
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kindly show us what is there in your "moduleList" object. What data has you set in it?
 
Jigar Naik
Ranch Hand
Posts: 763
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey Patricia,

Thanks for the reply...

Well i've checked that moduleList object which i was setting in the request scope, moduleList object was not containing the proper values.

Now it's working fine.

Thanks a lot.
Regards,
Jigar
 
You have to be odd to be #1 - Seuss. An odd little ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!