简体   繁体   English

IE10浏览器-X-UA兼容的“ content =” IE = 8无法正常工作

[英]IE10 browser - X-UA-Compatible“ content=”IE=8 is not working

My application is working fine IE8, When it comes to IE10 it is only working fine in computability view and with IE8 standards. 我的应用程序在IE8上运行良好,当谈到IE10时,它仅在可计算性视图和IE8标准下运行良好。 To force the browser working in same mode I have used below code in my jsp 为了强制浏览器以相同的模式工作,我在jsp中使用了以下代码

<!DOCTYPE HTML>
<html>
  --any code
  <head>
    <meta http-equiv="X-UA-Compatible" content="IE=8">
  </head>
  --any code
</html>

But IE10 always used IE7 standards. 但是IE10始终使用IE7标准。 Is there any thing wrong in above code? 上面的代码有什么问题吗? Please suggest. 请提出建议。

I made it working through servelet filter which will always ensure working in same mode. 我通过servelet过滤器使其工作,它将始终确保以相同模式工作。

 public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws ServletException, IOException {
    if (compatibilityMode != null) {
        HttpServletResponse res = (HttpServletResponse) resp;
        res.addHeader("X-UA-Compatible", compatibilityMode);
    }
    chain.doFilter(req, resp);
}
public void init(FilterConfig config) throws ServletException {
  String compatibilityMode = config.getInitParameter("compatibilityMode");
}

Set computability mode through web.xml using below 使用以下内容通过web.xml设置可计算性模式

<filter>
    ....
    <init-param>
        <param-name>compatibilityMode</param-name>
        <param-value>IE=8</param-value>
    </init-param>
</filter>

<filter-mapping>
    <filter-name>filter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 “X-UA兼容”内容=“IE = 9; IE = 8; IE = 7; IE = EDGE” - “X-UA-Compatible” content=“IE=9; IE=8; IE=7; IE=EDGE” 不应该在IE10中“兼容X-UA兼容IE =边缘”标题覆盖“在兼容性视图中显示内部网站点”? - Shouldn't “X-UA-Compatible IE=edge” header override “Display intranet sites in Compatibility View” in IE10? <meta http-equiv=“X-UA-Compatible” content=“IE=Edge” />在IE 11中无法正常工作 - <meta http-equiv=“X-UA-Compatible” content=“IE=Edge” /> is not working in IE 11 内容页面<meta http-equiv=“X-UA-Compatible” content=“IE=10”/> - Content page with <meta http-equiv=“X-UA-Compatible” content=“IE=10”/> 在IE8的Intranet中与X-UA兼容 - X-UA-Compatible in a intranet for IE8 IE忽略响应头中的X-UA兼容IE =边缘 - IE ignores X-UA-Compatible IE=edge in response header 如果我使用&#39;在Microsoft Edge浏览器上会出现渲染问题 <meta http-equiv=“X-UA-Compatible” content=“IE=7” /> &#39;? - Would rendering problems occur on Microsoft edge browser if I use '<meta http-equiv=“X-UA-Compatible” content=“IE=7” />'? 我如何知道我网站的内容是否与元标记X-UA-Compatible / IE = edge兼容? - How do I know if the content of my site is compatible with the meta tag X-UA-Compatible/IE=edge? 使用X-UA-Compatible在公司设置中模拟IE9 - Using X-UA-Compatible to emulate IE9 in corporate setup 做什么<meta http-equiv="X-UA-Compatible" content="IE=edge">做? - What does <meta http-equiv="X-UA-Compatible" content="IE=edge"> do?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM