• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

accessing map values in EL

 
geeta vemula
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

What is the output of this page? (1 correct answer)


“Hey !!”
“Hey Rihanna!!”
None of the above.

answer is c.

what is happenenig here? whether the syntax is wrong or simply it is considering like ${requestScope.names[<%= 1]}!!

thanks,
geeta
 
Chinmaya Chowdary
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Geeta. In
${requestScope.names[<%= names.length - 2%>]}
, during translation, the container replaces the jsp expression with out.write(names.length-2); which is invalid. Here option C is correct.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic