Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Have the rules for EL in a JSP changed?

 
Pat Farrell
Rancher
Posts: 4678
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am building a new servlet/jsp/EL application. It uses code that has been working for ages, or more precisely, code that I copied that used to work perfectly. My EL loops are not working.

I have stored a List<String> under the name "msgList" in the session. The JSP looks like:



The output from the first line, with the explicit indexing into the list works fine, but the forEach loop displays nothing.
The proxy shows



I'm baffled as to what I've done wrong, and how I can fix it.

 
Paul Clapham
Sheriff
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does your taglib declaration for "c" look like?
 
Pat Farrell
Rancher
Posts: 4678
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you. That is what I forgot.
Or rather forgot to copy into the "top.jspf" that I include everywhere.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64827
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you ever end up seeing JSTL tags in the browser source, you know that the JSTL is not getting evaluated.
 
Pat Farrell
Rancher
Posts: 4678
7
Linux Mac OS X VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:If you ever end up seeing JSTL tags in the browser source, you know that the JSTL is not getting evaluated.

I was thinking that it was most strange to see the <c:forEach...>
as I've never seen it before and I've been using JSTL for at least five years.

But my brain didn't make the connection that I left out the one line linkage.

Thanks for the help.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic