• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to add EL expression inside a EL expression?

 
Russell Tao
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
eg. ${map[${key}]} seems can not compile.

What to do?
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,


Nested EL does not permitted as per the EL syntax rules.

Thanks
 
Charles Lyons
Author
Ranch Hand
Posts: 836
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
eg. ${map[${key}]} seems can not compile.
There is no need to do this. The following achieves what you want:If you're familiar with scriptlets, would you do <% map.get(<% key %>); %>? Probably not - it would be invalid. You'd instead choose to do:The same applies to EL expressions.
[ July 28, 2006: Message edited by: Charles Lyons ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic