You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jon Nelson <jo...@dessci.com> on 2003/09/09 21:17:40 UTC
Help with Responses and Internet Explorer
Hi,
I'm running Tomcat 4.1.24 on a Windows XP machine. I also have Apache
2.0.46
running, but the two are not connected. I have two questions related to
Responses and Internet Explorer.
My test file (test.xml) is an xml file. We have developed a control for
Internet Explorer that requests that any xml file be sent to a special
filter
to see if it should be applied to a page.
1. When I request my test file directly in Internet Explorer v6 via
http://myserver:8080/mycompany/test.xml
our filter is called and my file displays properly.
I can also request my test file via a ViewFile servlet:
http://myserver:8080/mycompany/servlet/ViewFile/test.xml
This servlet reads test.xml from the file system and returns it. I
also set the Content-Type to text/xml and the charset to utf-8.
Interent Explorer does not initially recognize this as an xml file
and our filter is not called. However, before the file is displayed,
Internet Explorer realizes that it is indeed an xml file and displays
it as such (but without our filter kicking in).
My question is, what is different in what Tomcat is sending to the
browser that would cause different behavior in these two
scenarios? I have matched the Header Response records as
much as I can, but what else should I look at (i.e., what else is
being transmitted to the browser and what can I control)?
I know Internet Explorer does not follow the standards in this area,
but if I can get Tomcat to do the same thing in each scenario, I
will be satisfied.
2. The other thing I noticed in fooling around with this, is that if you
do not specify a MIME type for a response, Tomcat will default it
to text/plain for a servlet. Where is this defined and how can I
change it?
Any help would be greatly appreciated.
Thanks,
Jon
RE: Help with Responses and Internet Explorer
Posted by Mike Curwen <gb...@gb-im.com>.
> -----Original Message-----
> From: Jon Nelson [mailto:jonn@dessci.com]
> Sent: Tuesday, September 09, 2003 2:18 PM
> To: 'tomcat-user@jakarta.apache.org'
> Subject: Help with Responses and Internet Explorer
>
<snip />
>
> 2. The other thing I noticed in fooling around with this, is
> that if you
> do not specify a MIME type for a response, Tomcat will default it
> to text/plain for a servlet. Where is this defined and how can I
> change it?
>
response.setContentType("text/xml");
?
> Any help would be greatly appreciated.
>
> Thanks,
> Jon
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>