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

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "redirect from jsp after download" Watch "redirect from jsp after download" New topic

redirect from jsp after download

prabhu kiran

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 to fire a new request to the file download and let the normal request be redirected.


Another way is to execute the download using Javascript during the onload event of another.jsp.
I agree. Here's the link:
subject: redirect from jsp after download
Similar Threads
submiting the output in same page
Redirect content to an external Page Flow
Auto Redirect Jsp Page
Processing icon with simple jsp approach
Need suggestions to count no of hits for Download link