This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error handling JSP page

 
Antonio Giovanni
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • 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 ]
 
Madhuri Chanda
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic