Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Simple Question

 
Nagesh Rachakonda
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am downloading an excel file to the client side using:
1. setContentType("application/excel") and
2. response.setHeader ("Content-Disposition", "attachment;filename=\""+requiredFileName+"\"");
It is successfully getting downloaded to the client end. Popping up windows dialog (Open-Save-Cancel-More Info). If I use save, everything is fine. But if I use Open, it opens up but there is a request process ongoing on the IE window Status bar.
Parent JSP/HTML has:
<a href="javascript:void(0);" onKlick="exportToExcel()">Export to Excel</a>
function exportToExcel() {
exportIFrame.location = "./destinationJSPName.jsp";
}
<IFRAME src="blank.html" id="exportIFrame" name="exportIFrame" FRAMEBORDER=0 SCROLLING=NO width="0" height="0">

Can anybody tell me what should I need to do, to avoid this request process ongoing on the status bar when you click 'Open' button?
Thanks
Nagesh.
 
Nagesh Rachakonda
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found the answer for the above.
Instead of using javascript:void(0) in the anchor tag, use just '#' will solve the problem.
Thanks for no replies.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64827
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for no replies.

This attitude is sure to make me rush to reply to a question of yours for which I do have an answer.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic