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

Problem in exporting output of jsp to excel file

 
Mandar Velankar
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am using Tomcat 5.0.16 , I try to export output of jsp page (data in tabular format) to excel file. It is creating a new(empty)excel sheet but problem is my data in tabular format is not exported.Where is problem?

I already made MIME Type entry in web.xml file in conf dir.

I used following code :
response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-Disposition","attachment; filename=myFilename.xls");

Surprise is above code is working for one jsp page (in different dir) but not in current page.
Where is mistake? Can anybody help me?
Thanks a lot.
Regards,
Mandar Velankar
 
Muhammad Saifuddin
Ranch Hand
Posts: 1324
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Mandar Velankar:

I already made MIME Type entry in web.xml file in conf dir.


why you entered MIME type entry in web.xml. You have already defined in you jsp though?


have a look this example of JSP and Excel in javaranch..
[ January 19, 2007: Message edited by: Saif uddin ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic