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:

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


Luca Cicala hat gesagt…

Many thanks for your post!!

Simon Martinelli hat gesagt…

You are welcome!

Balbuceos Joe hat gesagt…

Thank you very much for sharing your solution.

It works great for me!