Search code examples
jsf-2primefacestomcat6

Primefaces IE9 X-UA-COMPATIBLE


I m using primefaces 5.1 with spring 4 and all work like a charm on firefox, but my client want that PF works on IE9, and when i test some page, i see that render are different, and after a google search, i find this :

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

and miracle all work fine!

well almost...

All pages are ok but when i go back under eclipse console i see many errors!!! like :

INFO: Server startup in 3280 ms 
10 avr. 2015 09:27:59 com.sun.faces.application.resource.ResourceHandlerImpl logMissingResource
ATTENTION: JSF1064 : Impossible de localiser ou de servir une ressource, theme.css, depuis la bibliothèque primefaces-aristo.
10 avr. 2015 09:27:59 com.sun.faces.application.resource.ResourceHandlerImpl logMissingResource
ATTENTION: 
ClientAbortException:  java.net.SocketException: Connection reset by peer: socket write error
at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:369)
at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:448)
at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:363)
...
Caused by: java.net.SocketException: Connection reset by peer: socket write error
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
...
10 avr. 2015 09:27:59 com.sun.faces.application.resource.ResourceHandlerImpl logMissingResource
ATTENTION: JSF1064 : Impossible de localiser ou de servir une ressource, primefaces.css, depuis la bibliothèque primefaces.
10 avr. 2015 09:27:59 com.sun.faces.application.resource.ResourceHandlerImpl logMissingResource
ATTENTION: 
ClientAbortException:  java.net.SocketException: Software caused connection abort: socket write error
at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:369)
at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:448)
at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:363)
...

i see that primefaces-aristo theme is default theme and present into primefaces-5.1.jar so its not a classpath problem because other css / js are ok

my header :

<f:facet name="first">
    <meta http-equiv="X-UA-Compatible" content="IE=9" /> 
</f:facet>
<h:outputScript library="primefaces" name="jquery/jquery.js" />
<h:outputScript library="primefaces" name="jquery/jquery-plugins.js" />
<h:outputScript library="primefaces" name="primefaces.js" />
<h:outputStylesheet library="primefaces" name="primefaces.css"/>
<h:outputStylesheet library="primefaces" name="jquery/ui/jquery-ui.css"/>

so if it was resources not found problem, i should see it in firefox too? and in IE9 the page is correctly showed, so i don t understand clearly this error.

Environnement

-primefaces 5.1
-jsf 2.2.9
-spring 4.1.4
-el-impl 2.2
-jsp-api 2.1.3-b03
-jsf-api 2.2.9
-jsf-impl 2.2.9
-el-api 2.1.2-b05
 tomcat 6

any help will be appreciate :)


Solution

  • When you first open a page in IE, it immediately starts loading resources. Then IE considers switching to compatibility mode. If it does decide to do that, then it aborts all the resource requests and starts them anew. That's why you see those log messages. They're not important in this case, pages will work fine.

    You could just tell to IE to disable compatibility mode completely, and always use the actual version by setting the X-UA-Compatible header to IE=edge. Then it won't abort requests anymore.