File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes What is the purpose for isErrorPage= true| false? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "What is the purpose for isErrorPage= true| false?" Watch "What is the purpose for isErrorPage= true| false?" New topic
Author

What is the purpose for isErrorPage= true| false?

Varun Selva
Ranch Hand

Joined: Jun 17, 2012
Posts: 44

What is the purpose for isErrorPage= true| false?
I know that the exception object will work only when isErrorPage= true.

Scriptlet <%= exception %> is working if the isErrorPage attribute set as true.
But EL {pagecontext.exception} will work whether true or false.

WHY???


Varun Selva
Durgesh Vaishnav
Greenhorn

Joined: Oct 06, 2006
Posts: 16

Implicit objects in jsp are the objects that are created by the container automatically and the container makes them available to the developers. Exception object has a page scope and this object allows the exception data to be accessed only by designated JSP "error pages. When a JSP page has been declared an errorPage=true, it is made available this object with name of "exception" of type java.lang.Throwable.

in your case, you cann't access exception like {exception}. but it is available via pagecontext.


Enthusiasm is the engine of success!!
SCJP 1.4, OCPJP6
Varun Selva
Ranch Hand

Joined: Jun 17, 2012
Posts: 44

Thanks Durgesh Vaishnav!
I got the idea.
Varun Selva
Ranch Hand

Joined: Jun 17, 2012
Posts: 44

;
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: What is the purpose for isErrorPage= true| false?