wood burning stoves 2.0*
The moose likes JSP and the fly likes Have the rules for EL in a JSP changed? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Have the rules for EL in a JSP changed?" Watch "Have the rules for EL in a JSP changed?" New topic
Author

Have the rules for EL in a JSP changed?

Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4634
    
    5

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
Bartender

Joined: Oct 14, 2005
Posts: 18110
    
    8

What does your taglib declaration for "c" look like?
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4634
    
    5

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

Joined: Jan 10, 2002
Posts: 60041
    
  65

If you ever end up seeing JSTL tags in the browser source, you know that the JSTL is not getting evaluated.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4634
    
    5

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Have the rules for EL in a JSP changed?
 
Similar Threads
using EL to get the keySet of a HashMap
forEach nested loop
Baffling NPE in <c:forEach
Is for each on a map with EL possible?
using JSTL and EL to get/set request parameters