Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

The content type for office excel 2007 in jsp page and the mime-type in we

843840May 28 2008 — edited May 29 2008
Hi,

In my system MS Office 2007 is installed. I am trying to generating excel sheets from JSP page by setting the content type "application/vnd.ms-excel" in jsp page and as well as in web.xml file. I am getting the below message
The file you are trying to open, 'xxxxxxxx.xls', is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now?

Then finally the excel file is opening and displaying properly. If in my system MS Office 2003 is installed , then the above message is not coming.
I have changed the content type according to Excel 2007 <%@ page contentType= "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" %> and in web.xml file the mime type to
<mime-mapping>
<extension>xlsx</extension>
<mime-type>application/vnd.openxmlformats-officedocument.spreadsheetml.sheet</mime-type>
</mime-mapping>

even the content type is changed according to office excel 2007 , i am getting the same above message.

My client is asking not to display the above message. So how to prevent that message ?

It's very great if any body reply me as soon as possible.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 26 2008
Added on May 28 2008
10 comments
1,707 views