Using c:forEach with Seam, JSF, and Facelets
After a couple of hours of scratching my head and Googling the Interwebs like a mad man I finally figured out why my c:forEach wasn’t iterating and displaying the data in my view. Come to find out I was using the wrong name space when declaring the JSTL core library.
First off here is the c:forEach code.
1 2 3 4 | <c:forEach items="#{item.tags}" var="tag"> <h:outputText value="#{tag.name}"/> <br/> </c:forEach> |
Here is the incorrect name space causing the issues. Notice the word jsp in the path.
1 | xmlns:c="http://java.sun.com/jsp/jstl/core" |
Now for the correct name space. Just remove the word jsp from the path.
1 | xmlns:c="http://java.sun.com/jstl/core" |
Bingo. Now everything is working. Don’t make same boneheaded mistake.










Dennis April 8th
Thank you sooooo much.
I had the same problem for the same reason. And after googling for hours, I finally found you page. Thanks!
Brian April 8th
Dennis,
You are very welcome. Glad to know it helped somebody. This issue threw me for a loop because the other namespace is valid but just doesn’t work.
Kevin July 29th
Thank u very much! That helps me a lot!
Brian July 29th
You are welcome Kevin. Glad it saved you some time.
Add Yours
YOU