Problem with IE9 + RichFaces Rendering

I have a web application that runs on JSF 2.0 + Richfaces 3.3.3. Looks great in all browsers except IE9.

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

Note that all components in the frame and CSS are ignored (not visible?)

JSP is as follows: (Relevant material only):

<!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 is located in C:\apache\tomcat\webapps\MyWebApp\css\pageStyle.css

Anyone got it? Thanks!

UPDATE Conducted some research using the "developer tools", capturing packages with the network tab. The css file is sent with type = text/html instead of text/css . I think the problem is in line with this question.

But I still don’t know why this is happening. As you can see, the file type is clearly indicated as type="text/css in the <link> .

Another interesting observation is the consideration of the same object in the Chrome developer tools, the content type is text/css , perhaps this is an IE9 error. I'm confused...

+3
source share
3 answers

RichFaces 3.x does not support IE9 (and it is not planned to be introduced), refer to this topic: http://community.jboss.org/thread/156720

You can upgrade to RF 4,

or implement a filter to get IE9 to work 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); } 
+3
source

Richfaces 3.3 precedes IE9 coming out of beta, so compatibility problems will not be possible since the build probably has not been tested against IE9.

The good news is that you are using JSF 2, so there is no reason why you cannot upgrade to Richfaces 4 Final, which definitely supports IE9.

So the version of JSF you are using is also important. I use mojarra and in version 2.0.4 I had problems with many Richfaces components when they were reloaded with mojarra.ab (f: ajax). Upgrading to version 2.1.1 seems to have resolved all these problems, and now I have Richfaces code that works well for IE9 users.

I would recommend you take a look at the upgrade path and see how viable it is.

+2
source

The problem is that IE9 needs the HTTP response for the css file to have a Content-Type header. Your HTTP response headers should look like this:

 Content-Type: text/css 

Possible Solution. You can create a Servlet that captures HTTP requests and decorates response headers with Content-Type values.

+2
source

All Articles