javahttpinternet-explorer-8tomcat5.5

Configure Tomcat to send web pages compatible to IE 7 or 6


I have got an application that is not compatible to work using IE8 browser.

I am looking for a way to to configure Tomcat on which this application run, so the pages could be read by IE8 and treated as if they are IE7 or IE6

By googling so far I found a possible suggestion which say to add to the http response the header: X-UA-Compatible: IE=EmulateIE7
here

that tell IE8 to be like IE7.

The problem is that this way requires adding a filter that should be added on application level. I'd like to know if any of you is familiar with a more generic way that Tomcat enables to send its http content to be IE7 (or IE6) compatible ?


Solution

  • Tomcat is a general purpose webserver and servlet container. It is absolutely browser-agnostic thus, there's no way to configure it in some special way to deal with IEs.

    You don't have to add filter really. The bare minimum is to set the response header anywhere in "service" method (or doGet or doPost, whatever application uses):

    res.addHeader("X-UA-Compatible", "IE=EmulateIE7 ");

    But this is in case when there's a single entry point in the server application. Otherwise filter should do the job in a better way.