Solved

Content type in a servlet

Posted on 2001-07-31
6
1,369 Views
Last Modified: 2013-11-24
I am trying to redirect the contents of my page to a spreadsheet and I use
res.setContentType("application/vnd.ms-excel");
to set the content type.
This works when I use Excel 97 but with newer releases of Excel (eg: 2000) it doesn't.
Help!!!
Thanks.
0
Comment
Question by:luw
  • 4
  • 2
6 Comments
 
LVL 1

Expert Comment

by:dviji
ID: 6338301
Hi,
   Some suggestion to find out that MIME Type...
  Open explorer and goto View -> Folder Options. In that goto file types tab, in that search for Microsoft Excel Worksheet. It will give you what is the Content Type(MIME type). Apply this in your ContentType. It may help you.


...dviji
0
 

Author Comment

by:luw
ID: 6340935
Thanks. Now I know what the MIME types are for Excel 97 and Excel 2000. But how can write my servlet to work with both versions? Thanks.
0
 

Author Comment

by:luw
ID: 6340938
Thanks. Now I know what the MIME types are for Excel 97 and Excel 2000. But how can write my servlet to work with both versions? Thanks.
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 1

Accepted Solution

by:
dviji earned 100 total points
ID: 6341122
You can get the available mimie types by using javascript navaigator.mimeTypes

But one thing is navigator works only in Netscape ;-(((. I don't know how to check in IE...

...dviji
0
 

Author Comment

by:luw
ID: 6342076
Thanks for the info. Can you give me some examples on how I can use it?
0
 

Author Comment

by:luw
ID: 6388890
Thanks for all the info. I'm still trying to find out how to get my code to work with Excel 2000. Sorry for the delayed repsonse!
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
endX challenge 2 49
Problem to start Neon 20 52
micro services spring boot application error 3 28
eclipse java  build path 6 20
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now