Hi everyone, I'm new to
JSP. I am trying to learn more on response.sendRedirect and requestDispatcher.forward.
While playing around with some codings, I got puzzled over why codes after requestDispatcher.forward are still executed.
I have included my codes and output in the image attached. Could someone point to me why the 4 lines of System.out.println() are executed after
requestDispatcher.forward?
//Edited
I tried replacing requestDispatcher.forward with response.sendRedirect. And the println() are still executed. So, I'm assuming regardless of whether is it
.forward or .sendRedirect, control is
always returned to the callee? I tried searching for answers but it seems like the answers given by others vary too !
Now I'm getting more confused! Ha :)
Anyway, is there a way that the control would not be returned to the callee ?
Thanks in advance!