寫個class繼承javax.servlet.Filter,在doFilter裡撰寫以下程式:
public void doFilter(ServletRequest aRequest, ServletResponse aResponse, FilterChain aChain)
throws IOException, ServletException {
//強迫IE用IE7的相容性檢視模式
((HttpServletResponse) aResponse).setHeader("X-UA-Compatible", "IE=EmulateIE7");
aChain.doFilter(aRequest, aResponse);
}