This week's book / license giveaways are in the JDBC and Relational Databases and Java in General forums.
We're giving away four copies each of PostGIS in Action and Java Advanced Topics Training and have the authors on-line!
See this thread and this one for details.
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


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: 31798
    
192

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.


[OCA 8 book] [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 .