• Post Reply Bookmark Topic Watch Topic
  • New Topic

exporting as excel  RSS feed

 
rakesh sugirtharaj
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I�m using a servlet for �export to excel� functionality in my jspx page. When I click on the excel img ,the servlet request is considered a new request and a blank page is displayed. I want to retain my original page as this servlet will give me only a dialog.
 
sujit suncert
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you the excel window popped up in your blank page?

If yes, and you want to stay in the same page I can guess whats wrong in your code.From your servlet don't forward or redirect anywhere.

response.setContentType("application/vnd.ms-excel");
response.addHeader("Content-Disposition", "attachment; filename=\""+fileName+"\"");
response.write(stream);//write to stream
close stream and close response...

Thats all..your code ends here.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"sujit sun certified", please check your private messages for an important administrative matter.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!