• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

regarding page directive: errorPage

 
saima kanwal
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 :

 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shouldn't you check for an empty string instead of null ?
 
saima kanwal
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh , thanks , it is working now.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic