JSF application using IE11 with Enterprise Mode
Asked Answered
F

2

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.

Fraternal answered 11/12, 2014 at 16:37 Comment(4)
It is reasonable to upgrade JSF and RichFaces? Or reprograme application with different technologies?Fraternal
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 <html> element. ( technet.microsoft.com/library/dn640687.aspx ) No sense build application now to run on IE8 engine.Simplex
Try add http header "X-UA-Compatible: IE=Edge" from Servlet filter. e.g: response.addHeader("X-UA-Compatible", "IE=Edge");Simplex
Problem was with parsing xhtml..Fraternal
F
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);
    }

     }
 }
Fraternal answered 19/12, 2014 at 10:34 Comment(0)
T
-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

Teriann answered 17/12, 2014 at 5:25 Comment(1)
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..Fraternal

© 2022 - 2024 — McMap. All rights reserved.