There you'll find the relevant information... The following jsp will output your ip address and user-agent:
Your user-agent is:
Code:
<%=request.getHeader("user-agent")%>
Your IP address is:
Code:
<%=request.getRemoteAddr()%>
To find out what browser and/or OS the user is using, parse the user-agent header. For example:
Code:
<% String userAgent = request.getHeader("user-agent"); if (userAgent.indexOf("MSIE") > -1) { out.println("Your browser is Microsoft Internet Explorer<br/>"); }
msi_333
Question subject: Re: how can we get browser information in jsp?
Posted: Mon Nov 02, 2009 3:15 pm
Joined: Tue Mar 27, 2007 10:55 pm Posts: 2103 Location: Earth Has thanked: 39 time Have thanks: 57 time
thanks for the addition .
_________________ Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )
jitendrasagoriya
Question subject: Re: how can we get browser information in jsp?
Posted: Tue Sep 27, 2011 11:25 am
you can user this function for get browser name and version