It's not a secret anymore!*
The moose likes JSP and the fly likes response.sendRedirect not working when Parent window is closed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "response.sendRedirect not working when Parent window is closed" Watch "response.sendRedirect not working when Parent window is closed" New topic
Author

response.sendRedirect not working when Parent window is closed

Sajee Joseph
Ranch Hand

Joined: Jan 17, 2001
Posts: 200
Hello all,

I have a jsp ( A.jsp). On click of a button 'Save' i invoke a servlet (ServletA) to get some operation done. after the operation is done i invoke 'B.jsp' using response.sendRedirect("/gem/B.jsp");
This works fine.
Actually the operation done ServletA is very time consuming. Thus as long as the user doesnt close 'A.jsp' browser window while the ServletA is executing, it work fine.
But if the user close the 'A.jsp' window, everything works fine except that the 'B.jsp' is not shown ie. response.sendRedirect("/gem/B.jsp") doent work anymore. How do i ensure that 'B.jsp' is shown even if 'A.jsp' browser window is closed
Sarath Mohan
Ranch Hand

Joined: Mar 17, 2001
Posts: 213
When the window is closed the request itself would close and thus response doen't have a destination.

You can think of progress window in between which itself will close when the servlet thread completes the timeconsuming process.

Regards


Sarath Mohan
 
jQuery in Action, 2nd edition
 
subject: response.sendRedirect not working when Parent window is closed
 
Similar Threads
how to redirect servlet to jsp on weblogic
request.setAttribute() and request.getAttribute()
response.sendRedirect not working when Parent window is closed - Help
Parent window Refresh
Can't open a jsp in a pop up or iframe from another jsp in the same struts portlet