Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

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.
 
Listen. That's my theme music. That's how I know I'm a super hero. That, and this tiny ad told me:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic