• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EL Doubt?

 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,

The following snippet is from Marcus Green's forum,

<html>
<%
String [] noises = {"cat","dog","cow"};
request.setAttribute("noises",noises);
%>
${requestScope.noises[0]}
${requestScope.noises["0"]}
${requestScope.noises['0']}
${noises[0]}
${noises["0"]}
${noises['0']}
</html>

I'm wondering on the lines that say noises[0] without an implicit object?? How is this possible? Can anyone please explain me??
 
Sergio Tridente
Ranch Hand
Posts: 329
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Container begins looking for the attribute in page scope and if it couldn't find it, it continues with the other scopes (request, session and application; in that order) until it finds it.
 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Sergio!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic