import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletResponse;
/**
* Servlet Filter implementation class IE8CompatablityFixServlet
*/
public class IE8CompatablityFixServlet implements Filter {
/**
* Default constructor.
*/
public IE8CompatablityFixServlet() {
}
/**
* @see Filter#destroy()
*/
public void destroy() {
}
/**
* @see Filter#doFilter(ServletRequest, ServletResponse, FilterChain)
*/
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
((HttpServletResponse) response).setHeader("X-UA-Compatible",
"IE=EmulateIE7");
chain.doFilter(request, response);
}
/**
* @see Filter#init(FilterConfig)
*/
public void init(FilterConfig fConfig) throws ServletException {
}
}
E no web.xml :
<filter>
<display-name>IE8CompatablityFixServlet</display-name>
<filter-name>IE8CompatablityFixServlet</filter-name>
<filter-class>br.com.sintel.plan.presentation.utils.IE8CompatablityFixServlet</filter-class>
</filter>
<filter-mapping>
<filter-name>IE8CompatablityFixServlet</filter-name>
<url-pattern>/IE8CompatablityFixServlet</url-pattern>
</filter-mapping>
Opção 2 :
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
...
<head/>
Particularmente .. a Opção 1 funciona melhor !
Abraços ...
Sem mais !
Nenhum comentário:
Postar um comentário