【Java】判断是否是IE浏览器

 //方法功能描述: 判断是否是IE浏览器   
    public boolean isMSBrowser(HttpServletRequest request) {  
        String[] IEBrowserSignals = {"MSIE", "Trident", "Edge"};  
        String userAgent = request.getHeader("User-Agent");  
        for (String signal : IEBrowserSignals) {              
        	if (userAgent.contains(signal)){  
                return true;  
            }  
        }  
        return false;  
    }

 

你可能感兴趣的:(Java,Java方法,Java)