title: Setting X-UA-Compatible in http header doesn't change document.documentMode for html in browser
body: <p>I have an application that supports IE9 (IE10 compatibility mode) and am trying view another application (supports IE10 only) in an IFrame. For the specific pages of the parent application making a call to the pages of the child application I want to render the parent and child pages in "IE=edge" or "IE=10" so that the functionality of the child application works.</p>
  
  <p>I wrote a servlet filter to interpret the request and set the value of User-Agent and X-UA-Compatible. However, the value of document.documentMode still shows as "8" i.e. IE 8 in javascript when the page is rendered. I am wondering what I am doing incorrectly. Pasted the code snippet below and any help is appreciated:-</p>
  
  <pre><code>public class DocumentsFilter implements Filter {
  
      public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain    filterChain) 
                  throws IOException, ServletException {
  
           HttpServletResponse resp = (HttpServletResponse)servletResponse;
           resp.addHeader("X-UA-Compatible", "IE=10");
  
           String ua = ((HttpServletRequest) servletRequest).getHeader("User-Agent");
           ua = ua.replaceAll("MSIE 7.0", "MSIE 10.0");
           resp.setHeader("User-Agent", ua);
  
           filterChain.doFilter(servletRequest, servletResponse);
  
     }
  
  }
  </code></pre>
  
  <p>Any help is appreciated.</p>