Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

response.sendRedirect not working when Parent window is closed - Help

 
Sajee Joseph
Ranch Hand
Posts: 200
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Regard's
Saj
 
Pavel Cherkashin
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you imagine it should work?
The new window should be opened?

As Far as I Understand:
You push Save-button and send request to ServletA.
ServletA does some job and send request back.

The problem is when you close the window you loose the response.
In other words while window of browser is opened you can send
request and receive the responce. But you can not receive response
after window is closed. The server will produce it for you, but you will
not see it. New window will not be opened for you.
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pavlo is right. There's nowhere for the response to be shown so it's never shown at all.
In fact, the redirect is never executed at all because there's nothing to execute the redirect!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic