• Post Reply Bookmark Topic Watch Topic
  • New Topic

Detecting browser type in a servlet

 
M Burke
Ranch Hand
Posts: 406
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to be able to detect IE 9, IE 10, IE 11 and the latest from Firefox and Chrome. The old method using the user-agent string is unreliable and not recommended. There is a different approach called, "Feature Detection". But I need to know what features to test to determine the browser. I can write it myself, or if there is a handy dandy API using feature detection already written that would be OK too.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65532
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't do feature detection to identify browsers, you use it to identify features and write the code to adapt to the presence or lack of those features.

In any case, none of this is done in a servlet, but in JavaScript on the page.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!