File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What happens after servlet throws an exception?

 
Sam Zheng
Ranch Hand
Posts: 61
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 1510
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic