I think what may be happening is IE is ignoring the text/plain attribute and 
converting your HTML in the document. Where as Netscape is displaying the correct 
attibute of text/plain and displaying the raw text. This is one of those "helpful" 
features(like "friendly" HTTP error pages)  Microsoft incorporates into IE ignoring 
the HTTP/HTML standards. 

As a quick and dirty solution you could put a meta tag in your page that sets the 
content type to text/html.


>>> [EMAIL PROTECTED] 12/21/00 01:23PM >>>


Guntupalli Shanti wrote:

> Thanks for the reply but I don't think that works.
> 2 reasons why:
>
> 1) As far as I understand when the request comes in for servlet it is
> passed to tomcat
> and from there onwards tomcat does the rest of the processing.
>
> 2) Also even if I use the ForceType directive it defaults all the files in
> that directory (which in my case are all servlets) to html
> which is not right.
>
> All I am doing in the servlet is to read the html template into a string,
> replace some variables and use the
> out.println(String) statement to send it back to the browser.
>
> Am I missing something ??
>

Are you calling

    response.setContentType("text/html");

before you call getWriter()?  If you don't, the server's default content type
will be assumed -- often "text/plain" -- which would cause the raw HTML code to
be displayed.

>
> Shanti
>

Craig McClanahan


>
> At 02:20 AM 12/20/2000 +0530, you wrote:
>
> >You can refer "ForceType" directive in Apache.
> >
> >Shuklix
> >
> >-----Original Message-----
> >From: Guntupalli Shanti [mailto:[EMAIL PROTECTED]] 
> >Sent: Wednesday, December 20, 2000 2:46 AM
> >To: [EMAIL PROTECTED] 
> >Subject: Netscape displaying the HTML code
> >
> >
> >Hi,
> >
> >I have tomcat 3.2 running on Apache 1.3.14.
> >All the HTML content in my web site is returned by the servlets based on
> >the templates passed
> >in the query. Something like
> >
> >http://www.myserver.com:8070/examples/servlet/servletname?page=main 
> >
> >where main is a html template file.
> >When I am accessing the page from IE I get exactly what I want
> >but when I access this in netscape it displays all the HTML code.
> >Does any one know how to fix it?
> >
> >Thanks in advance
> >Shanti

Reply via email to