• 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: 437
  • 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.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!