Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
William Fernandes
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64632
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're over-thinking it:


You don't nest ${}. It's not a fetch operator, it encompasses the entire EL expression.
 
William Fernandes
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64632
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the feedback, William!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic