IE 8 Problem while using primefaces 3.0

UI Components for JSF
Post Reply
tamizharasi
Posts: 52
Joined: 26 Jun 2011, 22:18

07 Jul 2011, 22:12

We are migrating jsf 1.2 & Primefaces 1.1 to JSF 2.0 & Primefaces 3.0. In JSF 1.2 & Primefaces we have used
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/></head>

To overcome IE8 compatibility issue. It was working fine. It was on jsps.

But while converting we have changed all the tags to xhtml tags. But this compatibility issue is still exists.

The xhtml is not taking meta tag. some primefaces doc type is overriding.How to overcome the problem? I am waiting for the solution.

tamizharasi
Posts: 52
Joined: 26 Jun 2011, 22:18

08 Jul 2011, 05:21

I tried the following code

<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.prime.com.tr/ui">
<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<title>Sample</title>

<link href="styles/styles.css" rel="stylesheet" type="text/css"/>
</h:head>

But the meta tag is no changing browser compatibility.

If I put like
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.prime.com.tr/ui">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>

The page is throwing "One or more resources have the target of 'head', but no 'head' component has been defined within the view.One or more resources have the target of 'head', but no 'head' component has been defined within the view." error

Help me to find the solution for the above issue

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

08 Jul 2011, 11:00

Hi,

See my workaround please which I have since more than 1 year yet http://ovaraksin.blogspot.com/2010/08/r ... o-fix.html

It's proved in at least two PrimeFaces projects.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

tamizharasi
Posts: 52
Joined: 26 Jun 2011, 22:18

09 Jul 2011, 00:09

Hi,
It is wonderful... It is solved my issues....

Thanks a lot... :D

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

09 Jul 2011, 15:08

I have posted this link 100+ times and got questions about it from other developers. Sadly that neither standard JSF nor PrimeFaces are not aware of such simple thing. In the fact I provided a patch to PrimeFaces ca. 1 year ago.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

tamizharasi
Posts: 52
Joined: 26 Jun 2011, 22:18

14 Jul 2011, 20:52

Hi,

The solution which you gave is working in my local and developer pC. But in UAT server it is failed and it throws the deployment error.


[javac] symbol : method getStateHelper()
[javac] location: class com.ge.idm.utils.common.Head
[javac] getStateHelper().put(PropertyKeys.title, title);
[javac] ^
[javac] /tmp/deployer/501956149/idm/war/src/com/ge/idm/utils/common/Head.java:48: cannot find symbol
[javac] symbol : method getStateHelper()
[javac] location: class com.ge.idm.utils.common.Head
[javac] return (String) getStateHelper().eval(PropertyKeys.shortcutIcon, null);
[javac] ^
[javac] /tmp/deployer/501956149/idm/war/src/com/ge/idm/utils/common/Head.java:52: cannot find symbol
[javac] symbol : method getStateHelper()


I am using JSF 2.0. The related jars are kept inside war lib. But the server JBOSS is having JSF 1.2 jars. SO we made the following entry in web.xml to refer war libs.

<context-param>
<param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.displayConfiguration</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.serializationProvider</param-name>
<param-value>
org.jboss.web.jsf.integration.serialization.JBossSerializationProvider
</param-value>
</context-param>

It was working fine. Our pages refers JSF2.0 only. But after adding this new tag-lib and head.java & headrenderer.java the deployment is failing.


I didn't found any other jar conflicting this class.

Waiting for your reply.

tamizharasi
Posts: 52
Joined: 26 Jun 2011, 22:18

20 Jul 2011, 04:44

I am able to solve the issue in a simple way.

I have added the value in the following way...
import javax.faces.context.FacesContext;
import javax.faces.event.PhaseEvent;
import javax.faces.event.PhaseId;
import javax.faces.event.PhaseListener;
import javax.servlet.http.HttpServletResponse;



public class MyFilter implements PhaseListener
{
public PhaseId getPhaseId()
{
return PhaseId.RENDER_RESPONSE;
}

public void afterPhase(PhaseEvent event)
{
}

public void beforePhase(PhaseEvent event)
{
FacesContext facesContext = event.getFacesContext();
HttpServletResponse response = (HttpServletResponse) facesContext
.getExternalContext().getResponse();
response.addHeader("X-UA-Compatible", "IE=8");

}
}

It solved the issue...

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 52 guests