aspose file tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes JSTL c:forEach not working Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Professional Certification » Web Component Certification (SCWCD/OCPJWCD)
Reply Bookmark "JSTL c:forEach not working" Watch "JSTL c:forEach not working" New topic
Author

JSTL c:forEach not working

Prithvi Sehgal
Ranch Hand

Joined: Oct 13, 2009
Posts: 767
Dear All,

I am going through chapter of JSTL in head first servlets and Jsp and i am trying to iterate through a collection of Employees
using JSTL c:forEach. This is the code





Here is the code for the Jsp



The strange thing is that the integer version of c:forEach is working but the below version is not. I am just showing the OR as an alternate
modification i did on the code. I don't know why it is not evaluating and not showing any values. Please help.

Another thing, i have noticed is, Employee list is coming as null. Any ideas why that is happening though i am setting list in session scope.

Please help.

BR,


Prithvi/Beenish,
My Blog, Follow me on Twitter,Scjp Tips, When you score low in mocks, Generics,Scjp Notes, JavaStudyGroup
Prithvi Sehgal
Ranch Hand

Joined: Oct 13, 2009
Posts: 767
Hi Guys,

Please ignore this question, its working now. I solved the problem.

BR,
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 3820

Maybe you could share what you did to solve the problem? So other people with a similar problem can benefit from your experiences.


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
Prithvi Sehgal
Ranch Hand

Joined: Oct 13, 2009
Posts: 767
Dear Roel,

It was a pretty stupid thing over my part. It has no issues. Actually, i was reading this chapter in free time in office and the most dumb mistake i made
was, i was directly calling the jsp, not invoking the servlet. In that case, no attribute was made and list was obviously empty. So no mistake in code, actually
mistake from my end.

Thanks,
 
 
subject: JSTL c:forEach not working
 
Threads others viewed
JSP, beans and sharing ArrayLists
Problem in accessing the Map in c:forEach loop of JSTL
Display data from database to jsp page.
Dropdown values not submitted
value for the useBean class attribute Invalid Problem
IntelliJ Java IDE

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture