wood burning stoves*
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 OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP 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
Author

will this throw exception/run perfectly???

Shashidhar Yarabati
Ranch Hand

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

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.

Regards
Prem Kashyap
Marcus Green
arch rival
Rancher

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


SCWCD: Online Course, 50,000+ words and 200+ questions
http://www.examulator.com/moodle/course/view.php?id=5&topic=all
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"
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: will this throw exception/run perfectly???