• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

regarding page directive: errorPage

 
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 :

 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • 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.
 
Whose rules are you playing by? This tiny ad doesn't respect those rules:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic