aspose file tools*
The moose likes Servlets and the fly likes doubt regarding servlet exception handling . Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "doubt regarding servlet exception handling ." Watch "doubt regarding servlet exception handling ." New topic
Author

doubt regarding servlet exception handling .

RaviNada Kiran
Ranch Hand

Joined: Jan 30, 2009
Posts: 528
If an exception occurs inside a catch block as shown :



Thanks in advance


If you want something you never had do something which you had never done
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30894
    
158

It seems faster to try it than ask on the web. But I didn't remember off the top of my head so I tried it.


outputs:
Exception in thread "main" java.lang.RuntimeException
at play.PlayTest.main(PlayTest.java:10)
a


So yes, the finally is executed and it is output last.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
RaviNada Kiran
Ranch Hand

Joined: Jan 30, 2009
Posts: 528
Jeanne Boyarsky ,

I want to know when a browser page is shown due to an exception , how the control goes back ??
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: doubt regarding servlet exception handling .