Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EL Head First doubt

 
Sharma Anjali
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HF page 395
<q>
Assume that there is not a property named "foo" , but there is an attribute named "bar" , but that "bar" does not have a property or key named "foo"

The following will not display anything

${bar[foo]}
</q>

But in case attribute bar is a bean, shouldn't it throw an exception if it does find a property named foo
 
P. Dunn
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you've been mislead by an error based on Q17 on p 432. The errata says C should not be checked. See http://www.oreilly.com/catalog/headservletsjsp/errata/

Usually EL/dot is friendly and should not throw an error.

However you may have something See:
http://www.coderanch.com/t/168664/java-Web-Component-SCWCD/certification/Passed-SCWCD

He says it'll throw an error.
[ February 23, 2005: Message edited by: P. Dunn ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic