Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to handle runtime ServletException?

 
yoginee Pathak
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
Could anybody help me by telling how to handle runtime SevletException?
Thank you
Yoginee
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13056
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The most important thing is to get the maximum amount of informaton from the exception. Your servlet engine is probably going to log the stack trace, so be sure to preserve the error log.
Note that ServletException can be thrown with a "root cause" Throwable attached - if you are catching ServletException, use getRootCause() and print the stack trace of that Throwable.
Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic