Following JSP code snippet behaves differently for different internet browsers.

Java Code:
<jsp:scriptlet>
StringuserAgent=(String)request.getHeader("user-agent");
</jsp:scriptlet>
<HTML>
<HEAD><TITLE>JSPScriptletExample</TITLE></HEAD>
<BODY>
<jsp:scriptlet>
if(userAgent.indexOf("MSIE")!=-1)
{
</jsp:scriptlet>
<p>YouareusingInternetMicrosoftExplorer.</p>
<jsp:scriptlet>
}
else
{
</jsp:scriptlet>
<p>YouarenotusingInternetMicrosoftExplorer.Youareusing<%=userAgent%></p>
<jsp:scriptlet>
}
</jsp:scriptlet>
</BODY>