Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
400 views
in Technique[技术] by (71.8m points)

css - IE9 + RichFaces Rendering problem

I have a web app which runs on JSF 2.0 + Richfaces 3.3.3. Looks great on all browsers except IE9.

In IE9 without compatibility mode (With, no problem) it looks something like this (ignore blacked out text): enter image description here

Notice how all the components are framed and CSS is ignored (Not seen?)

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>

The css is located at C:apacheomcatwebappsMyWebAppcsspageStyle.css

Anyone got any idea? Thanks!

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.

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.

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...

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

You can upgrade to RF 4,

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);
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...