JSP to Excel, Content-Type: Application/vnd.ms-excel won't work with Excel2003

Posted on 2005-03-01
Medium Priority
Last Modified: 2008-01-09
Hello Experts,

We have an JSP page that export the data to Excel by setting the response (ie Content-Type: Application/vnd.ms-excel). It works fine with Excel 97, but when we upgrade to Excel2003, the document is downloaded and opened fine. However when I want to save as, it thinks it is a HTML document and tries to save it as an web page document. I understand that from there I can change the file type to .xls and it will work fine. This extra step is very annoying and I am wondering if Excel still think it is a HTML document since it is downloaded from an jsp. We want to be able to save the document as an true excel document.


Question by:autoknowledge
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

zania22 earned 800 total points
ID: 13442514
Try using Apache's POI  project that gives an API to create and read excel files. you could put the logic in your .jsp file, use a servlet or or bean


its stable and works well. Its pretty much like:


//create file

worksheet worksheet  = new workbook()
sheet sheet = workbook.createSheet()
row row = sheet.createRow();
cell cell = cell.createCell();

for example, encapsulated very nice really easy to use

here is the api documentation as well:


Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
The top devops trends for 2017 are focused on improved deployment frequency, decreased lead time for change and decreased MTTR.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question