You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by William Rosenkranz <ro...@m2607det.msr.hp.com> on 2001/06/25 01:09:09 UTC

problem with mime type?

i am using tomcat 4.0-b5 with JDK 1.3 on a windows 2000 pro system.
i removed crimson.jar and jaxp.jar and installed xalan.jar and
xerces.jar from the 2.1.0 java dist. the servlet i wrote to do
the XML->HTML thing via XSLT works fine.

i added a mime type for excel (xls) files in conf/web.xml. i did
this just after the entry for application/msword. i tried both
application/vnd.ms-excel and application/excel (the former being
the propper type, according to IANA). when i request an excel
spreadsheet (with IE5) with:

	http://localhost:8080/foo/EXCEL/bar.xls

IE5 does not appear to recognize it as excel. the precise way i
am getting this is:

	* webapps/foo is my app
	* i ask for URL http://localhost:8080/foo/ which gives
	  me index.html in the foo dir
	* index.html has 3 frames which are in foo/frames
	* one of the frames has a link to "../EXCEL/bar.xls"
	  which gets translated to the URL above.

if, instead, i use

	file://%CATALINA_HOME%/webapps/foo/EXCEL/bar.xls

(where %CATALINA_HOME% is like C:/Jakarta/tomcat/4.0-b5) in the link,
it works fine (ie, IE5 opens the file as excel).

is it me or is this a bug in tomcat? i am fairly certain that
apache 1.3.x does this correctly on both NT and unix (hpux).

note: i restarted tomcat after changing conf/web.xml with a
shutdown/startup cycle.

just in case my servlet is somehow intercepting, in doGet() i do
a request.getReqestURI() and test endsWith("xls") on the string.
(as it turns out, my servlet has nothing to do with this.)

thanx

-bill