Monday, December 15, 2008

Firefox shows html not web page but IE Internet Explorer is fine

one of the simple portal page what we developed was rendering as HTML in IE browser, but mozilla firefox shows the HTML tags a text instead of rendering...

interesting and irritating, as we know that firefox is strictly checking HTML, we were looking DOCTYPE and every html tag in the page is well formed, tired... it is all well formed.... but still it works in IE and not in Firefox, we have gone through line by line the HTML source, yes yes content type is missing, then we added



But still not working in firefox, but IE it works fine…

Then we look our JSP’s again we added contentType="text/html; charset= utf-8 " in the jsp



But still not working in firefox, but IE it works fine…

I started scolding about firefox, just add a simple hellow world jsp and access that, it is working…….in IE and Firefox, but the real page is not working…

Then I access the page by calling jsp directly instead of calling from Servlet…. This is working…….in IE and Firefox also…

Then suddenly strikes out, is that the response content type issue which is not set in Servlet? this is a very basic thing, how do we miss it? Without much hope I look the servlet, oh ya… it is missing….

Just added response.setContentType("text/html"); in servlet, yehhhhh it works in firefox and IE, actually the cultprit is IE and not firefox,

Firefox display the out put as per the default “text/plain” , but the IE is ignoring the default “text/plain” and shows in HTML…

0 comments: