File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes What happens after servlet throws an exception? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "What happens after servlet throws an exception?" Watch "What happens after servlet throws an exception?" New topic
Author

What happens after servlet throws an exception?

Sam Zheng
Ranch Hand

Joined: Nov 29, 2000
Posts: 61

Hi everybody,
I have a question about exception handing in servlet.
If a servlet throws a ServletException in its service
method:
public void service(HttpServletRequest req,
HttpServletResponse res) throws ServletException{

}
What happens after this service throws the exception?
Who catches this ServletException?
Does the thread running the servlet die thereafter?
Thanks for your help! Sam
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1506
if the service method throws servlet exception, since the method delegates handling the exception to the caller of the method, the thread (the Server) that calls the method is responsible. The thread just exits.

Bosun


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What happens after servlet throws an exception?
 
Similar Threads
how to synchronize service() in servlets with out using singlethreadmodal interface
ServletException logged differently in Tomcat 5.5 and Tomcat 6.0
StringBuilder out of memory error
get request with out doGet()
How to send request data