my dog learned polymorphism
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes will this throw exception/run perfectly??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Customer Requirements for Developers this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "will this throw exception/run perfectly???" Watch "will this throw exception/run perfectly???" New topic

will this throw exception/run perfectly???

Shashidhar Yarabati
Ranch Hand

Joined: Jun 17, 2007
Posts: 175
<%@page isELIgnored='false'%>
<% request.setAttribute("pageContext", "pagecontext"); %>
pageContext = ${pageContext}

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 ]

Shashidhar<br /> SCJP 1.5<br /> SCWCD 5.0
Prem Kashyap
Ranch Hand

Joined: Oct 10, 2006
Posts: 52
Just try running the program? I think it will work fine.. But I am not sure.

Prem Kashyap
Marcus Green
arch rival

Joined: Sep 14, 1999
Posts: 2813
What happened when you compiled and ran the program?

SCWCD: Online Course, 50,000+ words and 200+ questions
Shashidhar Yarabati
Ranch Hand

Joined: Jun 17, 2007
Posts: 175
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

Joined: Jun 05, 2006
Posts: 46
it dosen't throw any exception..It calls pageContext's toString() method

Cheers<br />-------------<br />Swapnil<br /> <br />SCJP5-81%<br /> <br />"Dictionary is the only place where Success come before Work"
Consider Paul's rocket mass heater.
subject: will this throw exception/run perfectly???
It's not a secret anymore!