Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

browser type

 
Urik Zush
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Can anybody tell me how to detect the browser type in the JSP?
Thanks,
Urik.
 
Michael Hildner
Ranch Hand
Posts: 297
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where request is HttpServletRequest:
request.getHeader("user-agent");
 
Urik Zush
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Michael,
Using this method I got for IE
Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)
and for Netscape
Mozilla/4.08 [en] (WinNT; U)
but I need more specific info.
Thanks.
 
Michael Hildner
Ranch Hand
Posts: 297
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What kind of info do you need?
 
Urik Zush
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to know a distinguishing keyword I can check to tell me
what the browser type is.
Thnaks
Urik
 
Michael Hildner
Ranch Hand
Posts: 297
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did a search in this forum for 'browser type', lots of folks have asked this question (including me). From a quick look most people seem to check if it's not IE. I think I've seen AOL in the string for that browser. Wonder what other browser types give?
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the browser type contains "MSIE" then it is Microsoft Internet Explorer. If it doesn't but it does contain "Mozilla" then it is Netscape.
 
Michael Hildner
Ranch Hand
Posts: 297
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've always wondered, what does 'Mozilla' mean?
Never mind... good explanation here: http://www.dictionary.com/cgi-bin/dict.pl?term=Mozilla
[This message has been edited by Michael Hildner (edited April 06, 2001).]
 
Michael Hildner
Ranch Hand
Posts: 297
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wonder what this browser is?:
Mozilla/4.0 (compatible; MSIE 5.5; AOL 6.0; Windows 95)
This comes from a program I have that logs user information at login. According to Thomas, it would be IE, what's up with the 'AOL'?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic