Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

will this throw exception/run perfectly???

 
Shashidhar Yarabati
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<%@page isELIgnored='false'%>
<html>
<body>
<h1>
<% request.setAttribute("pageContext", "pagecontext"); %>
pageContext = ${pageContext}
</h1>
</body>
</html>

Since pageContext is Implicit Object to EL, the above code leads to throw an Exception

Am I right?
[ May 13, 2008: Message edited by: Shashidhar Rao ]
 
Prem Kashyap
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just try running the program? I think it will work fine.. But I am not sure.

Regards
Prem Kashyap
 
Marcus Green
arch rival
Rancher
Posts: 2813
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What happened when you compiled and ran the program?
 
Shashidhar Yarabati
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It compiled perfectly and gave output as follows
pageContext = org.apache.jasper.runtime.PageContextImpl@13576a2

But I have seen one question with the answer it throws exception
 
swapnil dangore
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it dosen't throw any exception..It calls pageContext's toString() method
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!