• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Error handling JSP page

 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,..

Firstly i have the error page declared in web.xml



Since the error type is Exception, i assumed it handles all the exceptions.

I was testing and this is what happened:

I was going thru the web application; logged off (session is expired) and
using browser Back button i somehow came to a an URL and pressed enter and surprising this jsp page was not called when a NullPointerException happened, and in the browser i have a page showing HTTP 500 , internal Server error ???

So should i also add



to web.xml to handle this?? I will also test by adding this HTTP err code and see where it goes..

Your ideas on this; Appreciate your help;
Thanks again


PS: How do you guys do error handling and what is the best way..
[ December 16, 2005: Message edited by: Bear Bibeault ]
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you will have to add different <error-page> tags for different type of errors (500,404 ..etc).

and the error-page in your web.xml handles the situations when there is an exception only (from your application code).

And moreover when you said you clicked the browser's back button and then clicked enter, you got null pointer exception.. that might not be actually a null pointer exception ... since the session has expired, it could not redirect you to the next page which is not due to any exception generated.

and you can aswell display different pages for different types of errors.

Hope that helps.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic