ket bhav wrote:I think that is cause of after Send Redirect your cursor will not go to next statement.
I am not sure can some one please comment on this...
Bear Bibeault wrote:
ket bhav wrote:I think that is cause of after Send Redirect your cursor will not go to next statement.
I am not sure can some one please comment on this...
Incorrect.
SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Everything's tough until you try your best
-Ashish Kataria,
Software Engineer
I too believe that code after SendRedirect will never run(although it will compile).
The reason being that every jsp page is compiled every time that page's url is hit.
SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Vijitha Kumara wrote:
Where did you get this? And this compilation has nothing to do with the question here.
Everything's tough until you try your best
-Ashish Kataria,
Software Engineer
Sunil Sunny wrote:No way once the Send redirect is executed control goes to another page. So now the interaction is with the new url to which it has been redirected. It does not points back to that statement after the "response.sendRedirect" code.
WRONG! Please do not post incorrect information.
Sunil Sunny wrote:Can you tell me sir where I am wrong
i do not think so.
once the statement response.sendRedirect is execcuted how the cursor will come back to the statment after respose.sendredirect.
Though it will compile but will never run.
I tried it just when i saw your last response and sir you must try it i am 100% right . I agree to that servlet is just like java class but come to the point of the topic control never returns to the statement after the calling statement For your information i am posting the code.
if you still think you are right and i am wrong . Please make me clear .
if you still think you are right and i am wrong . Please make me clear .
But you said cookie will not be set because i was redirecting to google . Actually i had also tried on a local redirection, it still did not work . that's why i said control will never return to the statement after sendredirect. But only one doubt remain in my mind that why the cookie was not set as the control has already returned to it .Boss you were right and it was pretty clear to me with the logging example when I tried it .