• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

EL Expression Question in HF Servlets and JSP  RSS feed

 
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
 
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
 
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
better check out the errata
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!