aspose file tools*
The moose likes JSP and the fly likes redirect from jsp after download Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "redirect from jsp after download" Watch "redirect from jsp after download" New topic
Author

redirect from jsp after download

prabhu kiran
Greenhorn

Joined: Jan 09, 2009
Posts: 1

can anybody tell me how to redirect to another jsp page after download is completed
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

can you elaborate your question . often , redirect to another jsp use response.sendRedirect("url")
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
prabhu kiran wrote:
can anybody tell me how to redirect to another jsp page after download is completed

That's not possible. You can send only one response per request. You already sent the file as response to the request. You cannot change it anymore nor mingle different responses into one response.

To send another response, the client has to send another request. So to send a download and a redirect, the client needs to send two requests. There are several ways to achieve this with a single click. Easiest way is to use Javascript's window.open() to fire a new request to the file download and let the normal request be redirected.

E.g.


Another way is to execute the download using Javascript during the onload event of another.jsp.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: redirect from jsp after download