aspose file tools*
The moose likes JSP and the fly likes Can I use EL to access the index of a list? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Can I use EL to access the index of a list?" Watch "Can I use EL to access the index of a list?" New topic
Author

Can I use EL to access the index of a list?

William Fernandes
Greenhorn

Joined: Jul 21, 2008
Posts: 16
Hi guys,

I'm trying to do the following:


Even though the param.chosenClass evaluates to an integer, I'm getting an error (contains invalid expression(s): javax.servlet.jsp.el.ELException: Encountered "{", expected one of [".", ">", "gt", "<", "lt", "==", "eq", "<=", "le", ">=", "ge", "!=", "ne", "[", "]") .

I want an EL expression for the index of the list. Is it possible? How?


Thank you!


SCJP 6
"A peaceful man stands tall" — "I tremble for my country when I reflect that God is just."
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60997
    
  65

You're over-thinking it:


You don't nest ${}. It's not a fetch operator, it encompasses the entire EL expression.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
William Fernandes
Greenhorn

Joined: Jul 21, 2008
Posts: 16
Bear Bibeault wrote:You're over-thinking it:


You don't nest ${}. It's not a fetch operator, it encompasses the entire EL expression.


Thanks a lot Bear.
I've read your article at RefCardz, good one!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60997
    
  65

Thanks for the feedback, William!
 
wood burning stoves
 
subject: Can I use EL to access the index of a list?