aspose file tools*
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
Author

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é
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

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.
 
wood burning stoves
 
subject: regarding page directive: errorPage
 
Similar Threads
jsp question - errorPage
Simple examples of JSP
Want my exceptions to be caught by errorPage JSP ?
My Shopping cart does not work
Getting null value in the form of jsp for submit button