This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes request.getHeader( Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "request.getHeader("User-Agent")" Watch "request.getHeader("User-Agent")" New topic


Sean Casey
Ranch Hand

Joined: Dec 16, 2000
Posts: 625
I was playing around with this, and noticed that in most cases it determines the browser type as well as the operating system it's running on. Is there a way we can determine dynamically the operating system of the user? I suppose I could turn it into a string and try to find certain substrings, but I was wondering if there was a method to determine the operating system. Thanks.
Tony Alicea

Joined: Jan 30, 2000
Posts: 3222
I doubt that there's a servlet request method that returns the OS.
In JavaScript, however, there is a browser object
that returns "Win32" in my case (WinNT4 SP6).
You can see what "User-Agent" your browser returns in my old page

Tony Alicea
Senior Java Web Application Developer, SCPJ2, SCWCD
It is sorta covered in the JavaRanch Style Guide.
subject: request.getHeader("User-Agent")
Similar Threads
How to lunch browser
Determine browser and os of web user?
snap shot of web page with JavaScript
Do we need to supply command line search for and book flights?