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 Expression Question in HF Servlets and JSP

 
Tim Puchala
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No doubt this has been asked before but I'm not too sure how to search in the topics for it.
It's Q.6 page 420.
I'm sure the answers to this question shouln't include F) which the book claims it does.
F. ${list[list['listIdx']]}

list is an attribute mapping to a util.List object.
listIdx is an attribute mapping to "1".
My understanding is that by virtue of the quotes around listIdx in F) it won't get mapped to "1" making it invalid since lists can't take strings in the [] operator.
Cheers
 
Manju Devarla
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but the option F) is ${list[list[listIdx]]} not
${list[list['listIdx']]}

${list[list[listIdx]]} is

${list[list[1]]}--> ${list[2]}--> c
 
Tim Puchala
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my book option F. is with the quotes, maybe your edition is more recent than mine, in which the typo has been fixed.
You do agree with me, tho, that F would be wrong as it is in my edition, I hope!
Cheers
 
Niranjan Deshpande
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
better check out the errata
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic