is IE via HttpServletRequest - Java javax.servlet.http

Java examples for javax.servlet.http:HttpServletRequest

Description

is IE via HttpServletRequest

Demo Code


import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.servlet.http.HttpServletRequest;

public class Main{
    public static boolean isIE(HttpServletRequest request) {
        return (request.getHeader("USER-AGENT").toLowerCase()
                .indexOf("msie") > 0 || request.getHeader("USER-AGENT")
                .toLowerCase().indexOf("rv:11.0") > 0) ? true : false;
    }//  w  ww . j a  v a2s .  c om
}

Related Tutorials