Wednesday, 16 July 2008

IE "Friendly" Error Pages

A few days ago, I was trying to create a small error page for 404 error for testing. The funny thing was the page showed up in Firefox but NOT in IE. I was pretty sure I edited the section of my web.xml properly (yes I'm sure I remembered how to do it correction from my SCWCD!!!). I was VERY VERY CONFUSED!!! : (

Luckily one of my colleagues came across this problem before. Apparently on IE5 and IE6 if a 404 error is thrown and the error page is LESS THAN 512 bytes...IE will try to be smart and use it's OWN "friendly" error page! -.- Wait...this does happen on IE7 too...because I was using IE7!!! (And IE will be smart for any error codes I think...not just 404).

The resolution of this is very simple (yet lame), I increased the size of my error page using a comment block. Note, if the error page is a JSP file, you MUST USE HTML comment block to make this work. If you use JSP comment, IE will not recgonise it as increasing the size of the file.

For the official detail about this "feature":
http://support.microsoft.com/kb/294807

1 comment:

  1. Yeah I've seen this one before and I blogged about it at work a couple of years ago. It was harder for me to know what the hell was going on, because back in the day I never used Firefox to develop applications. So when it wasn't working in IE, I had nothing to go on.

    It drove me to the bottle...painful memories.

    ReplyDelete