IE9 rendering IE8 document standard

I need my application to run in IE9 document standard and I can't figure out why it automatically renders in IE8 document standard.

I am using JSF 2.1.17 and Primefaces 3.4 running in Glassfish 3.1.2. My IDE is NetBeans-7.1.2. When I open the developer tools in IE, the HTML tab displays:

<--!DOCTYPE html-->
<html  xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 

      

However, the "Script" tab displays:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML lang=en xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<HEAD>
<META content="IE=8.0000" http-equiv="X-UA-Compatible">

      

I have looked through all my pages and templates and there is no where I can find the meta content = "IE = 8.0000" or the DOCTYPE shown above . It is very strange.

All my pages have:

<!DOCTYPE html> 

      

My main template has:

<!DOCTYPE html> 

<html   xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" 
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:p="http://primefaces.org/ui"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:f="http://java.sun.com/jsf/core">

      

Other pages:

<!DOCTYPE html>

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui"
                template="/layout/someFile.xhtml" >

      

Here's what I've tried:

1) Updated JSF Glassfish to 2.1.17 as I read that there was a bug with older versions of Mojarra causing it to ignore the DOCTYPE.

2) I added:

<meta http-equiv="X-UA-Compatible" content="IE=9" > 

      

to each page, hoping that IE9 would provide it, but it didn't work.

3) Then I tried using content = "IE = Edge", still no change.

4) I changed my DOCTYPE to:

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 

      

unsure if XHTML needed this strict DOCTYPE to render correctly. But it didn't work.

Any help would be great. I've done a lot of research trying to figure this out, but I'm new to web development, so I realize I'm pretty limited.

+3


source to share


1 answer


I added:

<meta http-equiv="X-UA-Compatible" content="IE=9" > 

      

to each page, hoping that IE9 would provide it, but it didn't work.

According to the MSDN file in this meta tag

The X-UA compliant header is not case sensitive; however, it must appear in the header of the web page (HEAD section) before all other elements except the header element and other meta elements.

it should look like before for all other elements <title>

and for other elements <meta>

. If you take a close look at the JSF / PrimeFaces based HTML, you will see that there will be a special <link>

PrimeFaces element in front of it that blocks the header X-UA-Compatible

from doing its job.



PrimeFaces supports several aspects for <h:head>

you to control the ordering of chapter resources. The following should do it for you:

<f:facet name="first">
    <meta http-equiv="X-UA-Compatible" content="IE=9" /> 
</f:facet>

      

Again, this is PrimeFaces specific and not standard JSF.

+5


source







All Articles