File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes How to handle runtime ServletException? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to handle runtime ServletException?" Watch "How to handle runtime ServletException?" New topic

How to handle runtime ServletException?

yoginee Pathak

Joined: Apr 25, 2001
Posts: 3
Hi all,
Could anybody help me by telling how to handle runtime SevletException?
Thank you
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13027
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.
I agree. Here's the link:
subject: How to handle runtime ServletException?
jQuery in Action, 3rd edition