Our application cannot run with IE11
and EM
. We are using modify JSF-1.2 and RichFaces 3.X . When we run Web page on IE11 without EM all working OK, but we have to use IE11
with EM
. Is any possible method to disable EM for page from code?
IE
console raising error: "XML5632: Only one root element is allowed." It occurs when moving between pages.
PS: Application working on IE8
, IE9
and IE11
without any problems but when you try it with IE11
and EM
It´s raising error.
Navigate to User Configuration > Administrative Templates > Windows Components > Internet Explorer. Scroll down and locate the Let users turn on and use Enterprise Mode from the Tools menu option. Double-click it, set it to Enabled, and users will be able to enable Enterprise Mode manually.
Go to the Use the Enterprise Mode IE website list setting, and then click Disabled. Enterprise Mode will no longer look for the site list, effectively turning off Enterprise Mode.
Solution for this problem is not sanding XHTML
from server but native HTML
. This providing filter which change response from application/xhtml+xml
to text/html
. Filter get response form header of user agent and find if is set „compatible; msie 8.0“
which means, that IE11
runs under Enterprise Mode and Emulate IE8
.
Our implemented solution:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
String userAgent = ((HttpServletRequest) request).getHeader("user-agent");
if (userAgent != null && userAgent.toLowerCase().contains("compatible; msie 8.0"))
{
chain.doFilter(request, new ForcableContentTypeWrapper((HttpServletResponse) response));
}
else
{
chain.doFilter(request, response);
}
}
private class ForcableContentTypeWrapper extends HttpServletResponseWrapper
{
public ForcableContentTypeWrapper(HttpServletResponse response)
{
super(response);
}
@Override
public void setContentType(String type)
{
if (type.contains("application/xhtml+xml"))
{
super.setContentType(type.replace("application/xhtml+xml",
"text/html"));
}
else
{
super.setContentType(type);
}
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With