7

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.

Freelancer
  • 836
  • 1
  • 14
  • 47
Eduard Baraniak
  • 421
  • 1
  • 10
  • 31
  • It is reasonable to _upgrade_ **JSF** and **RichFaces**? Or reprograme application with different technologies? – Eduard Baraniak Dec 16 '14 at 14:54
  • Enterprise mode definition: The page is currently being rendered in Enterprise Mode, which is an emulation of Windows Internet Explorer 8. And IE8 don't support iframe with element. ( http://technet.microsoft.com/library/dn640687.aspx ) No sense build application now to run on IE8 engine. – Reinaldo Gil Dec 18 '14 at 16:23
  • Try add http header "X-UA-Compatible: IE=Edge" from Servlet filter. e.g: response.addHeader("X-UA-Compatible", "IE=Edge"); – Reinaldo Gil Dec 18 '14 at 16:31
  • Problem was with parsing xhtml.. – Eduard Baraniak Dec 19 '14 at 11:08

2 Answers2

2

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);
    }

     }
 }
Freelancer
  • 836
  • 1
  • 14
  • 47
Eduard Baraniak
  • 421
  • 1
  • 10
  • 31
-1

If your application is just limited within the intranet and accessible within a confined network then you can disable EM thru the network's group policy

http://msdn.microsoft.com/en-us/library/dn640688.aspx

or, you can try to remove your application's URL from the SiteList file (the file where the registry EM entry is pointing at mentioned in the link above) so your application will not be included in the EM site list

Additional references: http://msdn.microsoft.com/en-us/library/dn640699.aspx

securecodeninja
  • 2,497
  • 3
  • 16
  • 22
  • This is not solution for me.. our customer have company policy for this and application running in Frame under other application which have to be run on EM. I Am asking for disable EM for page from code.. – Eduard Baraniak Dec 18 '14 at 10:19