File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes regarding page directive: errorPage 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 "regarding page directive: errorPage" Watch "regarding page directive: errorPage" New topic

regarding page directive: errorPage

saima kanwal
Ranch Hand

Joined: Oct 05, 2009
Posts: 148
I am studying Hanumant study kit for SCWCD. There I came across the page directive errorPage attribute. I tried it using a very simple example but unable to get the error page upon runtime exception.

My index.html code is :

My Servlet just gets a requestdispatcher and using forward method directs the request to result.jsp.

My result.jsp is:

Note here that i have use the directive

So it should throw a run time exception if i do not supply any value to username and should direct the page to ErrorHandler.jsp which is in the same directory as result.jsp. But i do not get any exception , neither does my page gets directed. what mistake am i making ?? can anyone help out??

My ErrorHandler.jsp is :

SCJP 6.0 (86%) SCWCD 5 (94%)
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

Shouldn't you check for an empty string instead of null ?

[My Blog]
All roads lead to JavaRanch
saima kanwal
Ranch Hand

Joined: Oct 05, 2009
Posts: 148
Oh , thanks , it is working now.
I agree. Here's the link:
subject: regarding page directive: errorPage
It's not a secret anymore!