IE9 + RichFaces渲染问题 [英] IE9 + RichFaces Rendering problem
问题描述
我有一个Web应用程序运行在JSF 2.0 + Richfaces 3.3.3。
I have a web app which runs on JSF 2.0 + Richfaces 3.3.3. Looks great on all browsers except IE9.
在IE9没有兼容模式(有,没有问题),它看起来像这样(忽略掉黑色的文本):
In IE9 without compatibility mode (With, no problem) it looks something like this (ignore blacked out text):
注意如何所有的组件框架和CSS被忽略(看不到?)
Notice how all the components are framed and CSS is ignored (Not seen?)
JSP看起来像这样(只有相关的东西):
The JSP looks like this (Only relevant stuff):
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf8">
<link rel="stylesheet" href="css/pageStyle.css" type="text/css" >
</head>
<body>
...
</body>
css位于 C:\apache\tomcat\ webapps\MyWebApp\css\pageStyle.css
任何人都有想法?
感谢!
Anyone got any idea? Thanks!
UPDATE
使用开发人员工具通过使用 network
选项卡。
css文件与Type = text / html
而不是 text / css
一起发送。我想这是根据此问题的问题。
UPDATE
Did some research with 'developer tools' by capturing packets with the network
tab.
The css file is sent with Type=text/html
instead of text/css
. I guess that's the problem according to this question.
但我还是不知道为什么会发生这种情况。如您所见,文件类型在< link>
中清楚标记为 type =text / css
But I still don't know why this happens. As you can see, the file type is clearly marked as type="text/css
in the <link>
tag.
另一个有趣的观察 - 在Chrome开发人员工具中检查同一个对象,内容类型为 text / css
所以也许它是一个IE9的错误我很困惑...
Another interesting observation - examining the same object in Chrome Developer Tools, the content-type is text/css
so maybe its a IE9 bug. I'm confused...
推荐答案
RichFaces 3。 x不支持IE9(没有计划引入它),请参考本主题:
http://community.jboss.org/thread/156720
RichFaces 3.x does not support IE9 (and there are no plans to introduce it), refer to this topic: http://community.jboss.org/thread/156720
您可以升级至RF 4,
You can upgrade to RF 4,
或实现一个过滤器以强制IE9以兼容模式运行:
or implement a filter to force IE9 to run in compatibility mode:
public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain) throws IOException, ServletException {
HttpServletResponse resp = (HttpServletResponse) response;
resp.addHeader("X-UA-Compatible", "IE=EmulateIE8");
chain.doFilter(request, resp);
}
这篇关于IE9 + RichFaces渲染问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!