Edd*_*mer 7 internet-explorer richfaces jsf-1.2 netweaver internet-explorer-11
我们的应用程序无法运行IE11和EM.我们使用修改JSF-1.2和RichFaces的3.X.当我们运行在网页IE11不EM所有工作正常,但我们必须使用IE11有EM.是否有任何可能的方法从代码中禁用EM for page?
IE控制台引发错误:" XML5632:只允许一个根元素. "它在页面之间移动时发生.
PS:应用工作IE8,IE9并IE11没有任何问题,但是当你尝试IE11和EMIt's提高错误.
这个问题的解决方案不是XHTML从服务器打磨而是从本地打磨HTML。这提供了将响应从 更改为 的过滤application/xhtml+xml器text/html。过滤获取用户代理的响应表单标头,并查找是否设置了\xe2\x80\x9ecompatible; msie 8.0\xe2\x80\x9c这意味着IE11在 Enterprise Mode 和 Emulate 下运行IE8。
我们实施的解决方案:
\n\npublic void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {\n\n String userAgent = ((HttpServletRequest) request).getHeader("user-agent");\n\n if (userAgent != null && userAgent.toLowerCase().contains("compatible; msie 8.0"))\n { \n chain.doFilter(request, new ForcableContentTypeWrapper((HttpServletResponse) response));\n }\n else \n {\n chain.doFilter(request, response);\n }\n}\n\nprivate class ForcableContentTypeWrapper extends HttpServletResponseWrapper\n{\n public ForcableContentTypeWrapper(HttpServletResponse response)\n {\n super(response);\n }\n\n @Override\n public void setContentType(String type)\n {\n if (type.contains("application/xhtml+xml")) \n {\n super.setContentType(type.replace("application/xhtml+xml", \n "text/html"));\n }\n else \n {\n super.setContentType(type);\n }\n\n }\n }\nRun Code Online (Sandbox Code Playgroud)\n
| 归档时间: |
|
| 查看次数: |
3431 次 |
| 最近记录: |