Java判斷瀏覽器類型

  1. /**
  2. * 判斷瀏覽器類型是不是IE,是則返回true,不是返回false
  3. * ServletActionContext是struts2上下文對象
  4. * @author 李英夫(2010-6-20 上午09:36:48)
  5. * @return boolean
  6. */
  7. public static boolean isIE(){
  8. return ServletActionContext.getRequest().getHeader( "USER-AGENT" ).toLowerCase().indexOf( "msie" ) > 0 ? true : false ;
  9. }  
相關文章
相關標籤/搜索