Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

head first servlets and jsp - page 420 - Q6

 
satguru srivastava
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On Page 420
Question 6
option F. ${list[list['listIdx']]} is show as correct.

Don't see how.
Option F should be ${list[list[listIdx]]} to be correct (no quotes around listIdx).
Thanks
Satguru
 
Roger Yates
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Satguru,

I agree. I just tried it and got the following:
javax.servlet.ServletException: The "[]" operator was supplied with an index value of type "java.lang.String" to be applied to a List or array, but that value cannot be converted to an integer

I checked on the errata pages and it's not there yet, so I've just logged it via:
http://www.oreilly.com/catalog/headservletsjsp/errata/

[ October 17, 2004: Message edited by: Roger Yates ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic