A couple of things:
1) Please check the 'disable smilies' checkbox when posting code. That way, your <c:out> tags will look less surprised! :o
2) I am assuming
JSP 2.0 and JSTL 1.1? The ternary operator is not supported in earlier versions.
3) The forEach tag will create its var in pageContext, so for debugging purposes you could fetch it from there in order to examine it.