is IE from HttpServletRequest - Java javax.servlet.http

Java examples for javax.servlet.http:HttpServletRequest

Description

is IE from HttpServletRequest

Demo Code


import javax.servlet.http.HttpServletRequest;

public class Main{
    // w  w  w . j a  va 2 s .c om
    public static boolean isIE11(HttpServletRequest request) {
        String agent = getAgent(request);
        if (null != agent && -1 != agent.indexOf("rv:11.0")) {
            return true;
        }
        return false;
    }
    
    public static String getAgent(HttpServletRequest request) {
        return request.getHeader("USER-AGENT");
    }
}

Related Tutorials