Java/JSTL/Browser

Материал из Java эксперт
Версия от 09:17, 1 июня 2010; Admin (обсуждение | вклад) (1 версия)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

JSTL RT Get Browser Info

   <source lang="java">

<%@ taglib uri="http://java.sun.ru/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.ru/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>


      </source>