Display excel problem in java

Hi all

I am getting a problem in my application. From my application when i try to open a excel sheet it workds fine. But when I try to rename the sheet name is gives first 4 characters like this .xls]filename. what i want is only filename.This is my code which i am using to preparing a excel file

response.setHeader("Cache-Control", "no-cache"); response.setHeader("Pragma", "no-cache");

response.setDateHeader("Expires", -1);

response.setContentType("application/ms-excel;");

response.setHeader("Content-Disposition", "attachment; filename=test.xls");

Even when i click on save as button In file type it gives .htm and *.html , what i want is .xls

waiting for you all's response

[735 byte] By [mehudona] at [2007-11-27 2:49:43]
# 1
1) Use "application/vnd.ms-excel" as contenttype, also see http://www.w3schools.com/media/media_mimeref.asp2) Preferably quote the filename.The downloadFile() snippet at the bottom of the article on http://balusc.xs4all.nl/srv/dev-jep-pdf.html might give useful insights.
BalusCa at 2007-7-12 3:21:17 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Thank you for your valuable suggestion.I already tried with vnd.ms-excel,even thogh its not working.any more idea on this?
mehudona at 2007-7-12 3:21:17 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
Have you removed the semicolon from the contenttype?Which useragent and OS have you used at the client? Are xls files at the client associated with the right program?
BalusCa at 2007-7-12 3:21:17 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
I removed semicolon from contenttype but still giving the same. I am using windows 2000 professional with IE 6I am not getting you client associated with right program?/ can you tell exact what you want to say..
mehudona at 2007-7-12 3:21:17 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
No one in forum,have any clue on this..
mehudona at 2007-7-12 3:21:17 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6

> I am not getting you client associated with right

> program?/ can you tell exact what you want to say..

At the client, what is the default application associated with xls files? Check Windows Explorer - Tools - Folder options - File type associations.

If this is OK, try to try a different useragent, for example Firefox. If it doesn't work in FF either, then capture the HTTP headers and check if the content is correct.

BalusCa at 2007-7-12 3:21:17 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...