Check Browser : Browser Type « JSTL « Java Tutorial






<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/core-rt" prefix="c-rt" %>
<html>
  <head>
    <title>Check Browser</title>
  </head>

  <body>
    <c-rt:choose>
      <c-rt:when test="<%=request.getHeader(\"User-Agent\").indexOf(\"MSIE\")!=-1%>">
      You are using Internet Explorer
      </c-rt:when>
      <c-rt:otherwise>
      You are using Netscape, or some other browser....
      </c-rt:otherwise>
    </c-rt:choose>
  </body>
</html>
  Download:  JSTLCheckBrowser.zip( 1,224 k)







24.31.Browser Type
24.31.1.Use Choose to Check the Browser Type
24.31.2.Check Browser