• Post Reply Bookmark Topic Watch Topic
  • New Topic

HFJS: EL Evaluations Gone Wild.

 
Michael Vargenstien
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Back agian, reading HFJS for the 10th time, savorying every sentence, over analyzing, over complicating cause that how Sun rolls. So...question, I'm looking at the section "If it's NOT a string literal, it's evaluated" in scriptless JSPs on page 377 (2nd Ed).

Music is: ${musicMap[Ambient]}


Find an attribute named "Ambient". Use the VALUE of that attribute as the key into the Map, or return null.

The question is, if the Ambient attribute was bound to another scope, say session or servletContext/application, would the evaulation still work? Does it work simliar to pageContext.findAttribute("Ambient") and if it finds anything bound in ANY scope, it will evaulate it?

Any input much appreciated
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65681
129
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. No matter where a scoped variable is referenced in an EL expression, the discovery process is the same.
 
Michael Vargenstien
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Bear!!
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!