This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

redirect from jsp after download

 
prabhu kiran
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

can anybody tell me how to redirect to another jsp page after download is completed
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you elaborate your question . often , redirect to another jsp use response.sendRedirect("url")
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic