aspose file tools*
The moose likes Servlets and the fly likes browser type Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "browser type" Watch "browser type" New topic
Author

browser type

Urik Zush
Greenhorn

Joined: Apr 06, 2001
Posts: 3
Hi,
Can anybody tell me how to detect the browser type in the JSP?
Thanks,
Urik.
Michael Hildner
Ranch Hand

Joined: Oct 13, 2000
Posts: 297
Where request is HttpServletRequest:
request.getHeader("user-agent");
Urik Zush
Greenhorn

Joined: Apr 06, 2001
Posts: 3
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

Joined: Oct 13, 2000
Posts: 297
What kind of info do you need?
Urik Zush
Greenhorn

Joined: Apr 06, 2001
Posts: 3
I need to know a distinguishing keyword I can check to tell me
what the browser type is.
Thnaks
Urik
Michael Hildner
Ranch Hand

Joined: Oct 13, 2000
Posts: 297
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

Joined: May 05, 2000
Posts: 13974
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.


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Michael Hildner
Ranch Hand

Joined: Oct 13, 2000
Posts: 297
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

Joined: Oct 13, 2000
Posts: 297
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'?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: browser type
 
Similar Threads
What is Javascript's default object
by using javascript rows are hiding in mozilla but it is working IE
problem with basic jsf tags in the jsp
HTML
help with pictures