This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread 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


Win a copy of Building Microservices this week in the Design 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: 32508
    
214

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]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, 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 ??
 
Have you checked out Aspose?
 
subject: doubt regarding servlet exception handling .
 
It's not a secret anymore!