try catch finally

if i am giving a page redirection inside a try block and also in finally block which page will come ?whether the one given inside the try block or finally block?
[168 byte] By [Nikhil_Krishnana] at [2007-11-27 1:20:59]
# 1
Can't you just force an exception to be thrown from the try block and see? (I'd be interested in the answer.)
pbrockway2a at 2007-7-11 23:58:24 > top of Java-index,Java Essentials,Java Programming...
# 2
It will execute the first one that it comes to.So if all is well then it will redirect according to the redirect in the try statement.If an exception is thrown before it is reached then it will redirect according to the finally statement.
ChristopherAngela at 2007-7-11 23:58:24 > top of Java-index,Java Essentials,Java Programming...
# 3
even if there is no exception,what will be the answer?
Nikhil_Krishnana at 2007-7-11 23:58:24 > top of Java-index,Java Essentials,Java Programming...
# 4
So christopher,finally block will always run according to java.Only exception case is System.exit().So i think it will be the filly b;lock which will be excecuted.What did u think?So my answer is second one.
Nikhil_Krishnana at 2007-7-11 23:58:24 > top of Java-index,Java Essentials,Java Programming...
# 5
It might depend on your web-app but tomcat will execute the first redirect that it comes across.You are right that the finally block will execute but I imagine this would throw an error as you can't redirect twice in one request so the first redirect would win.
ChristopherAngela at 2007-7-11 23:58:24 > top of Java-index,Java Essentials,Java Programming...
# 6
@Op. You should never have e.g a return (or in this case a redirect) in both the try and the finally clause. It's a very bad design to do that.Kaj
kajbja at 2007-7-11 23:58:24 > top of Java-index,Java Essentials,Java Programming...