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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
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: 774
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,
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: 774
Hi Guys,

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

BR,
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5545
    
  13

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: 774
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,
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSTL c:forEach not working