The answer to your IT questions
 

Advanced search  • Search tips
My QUESTIONS & ANSWERS
 Question:

How to detect browser type and version in JSP or Servlet

User Asked by: kuku
Published on: 13:33/20.05.2008
Status: OPEN
How can I detect the browser type and version in JSP file or Servlet? I'm mostly interested in FireFox and Internet Explorer versions.
 Answers: 1
Sort by: /\ date | rating
Image Answer by: xpert
Posted on: 13:33/20.05.2008
Rating: 2.3 from possible 5 with 3 votes


<%= request.getHeader("User-Agent") %>



When you request from FireFox above statement will result in:

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3

Then you can parse and extract info you need.
Vote:

Please vote! Your opinion matters!
If you haven't found what you've looking for, post a question
  
| Home | Hall of fame | Register | Log in | Terms of service | Help | Contacts |