How can I customize the HTML generated by my JSP file based upon what browser the user is using?

Brett Hyde

<%@ page import="javax.servlet.*" %>

<%
  String browserType = request.getHeader("User-Agent");
  String browser = "";
  if ((browserType.indexOf("MSIE") != -1) ||  
      (browserType.indexOf("msie") != -1))
  {
    browser = "Explorer";
  }
  else
  {
    browser = "Navigator";
  }
%>

Your browser is <%= browser%><BR>
0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact