04 November 2013

PrimeFaces 4 and Override IE Intranet Compatibility View Mode

We had the problem that since the migration to PrimeFaces 4 our JSF pages where displayed in IE compatibility view mode even though we specified the meta tag to control the IE mode:
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

The reason was that PrimeFaces puts the stylesheet links and the scripts right after the title tag.

After some research I found the solution on Stack Overflow:
http://stackoverflow.com/questions/14840259/ie9-rendering-ie8-document-standard

<h:head>
  <title>
    #{parameterBean.locationName} - #{parameterBean.version}   
  </title>
  <f:facet name="first">
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  </f:facet>
  <link rel="shortcut icon" href="/proshop/psicon.ico" />
  <h:outputStylesheet name="style.css" library="css" />
  <h:outputScript name="calendar_locales.js" library="scripts" />
</h:head>