JSF的Web应用程序在IE9无法正常工作。但在IE8中正常工作
问题描述:
我已经开发使用JSF 2.0 Web应用程序。它在IE 8和其他浏览器(Firefox和谷歌Chrome)工作的罚款。但它不是在IE9工作。能否请您解释JSF的IE9的兼容性,可以怎样做,这样我可以让我的应用程序工作在IE9。
I have developed web application using JSF 2.0. It is working fine in IE 8 and other browsers (firefox and google chrome). But it is not working in IE9. Can you please explain the IE9 compatibility for JSF and how it could be done so that I can make my App works in IE9.
答
我们也有一些问题,IE9和我们的解决方法是使用过滤器,告诉IE9在兼容模式下工作。
We also had some issues with IE9 and our workaround was to use a filter that tells the IE9 to work in compatibility mode.
的注意,这应该是最后的手段。你应该首先尝试使用过滤器之前为您解决具体问题(这是不明确你的问题解释)。的
兼容性模式使IE9松动圆角。
The compatibility mode causes IE9 to loose rounded corners.
@WebFilter("*.xhtml")
public class CompatibilityFilter implements Filter {
public CompatibilityFilter() { }
public void doFilter(ServletRequest request, ServletResponse res,
FilterChain chain) throws IOException, ServletException {
HttpServletResponse resp = (HttpServletResponse) res;
resp.addHeader("X-UA-Compatible", "IE=EmulateIE8");
resp.addHeader("Cache-Control", "no-cache, must-revalidate");
chain.doFilter(request, resp);
}
public void destroy() { }
public void init(FilterConfig fConfig) throws ServletException {
}
}