File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes getting users OS information Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "getting users OS information" Watch "getting users OS information" New topic

getting users OS information

Abhi Venu
Ranch Hand

Joined: Jul 09, 2009
Posts: 73
I have a web application. i need to get the information about the OS of users who are accessing this application.What are the possible ways to do it...??

A table, a chair, a bowl of fruit and a violin; what else does a man need to be happy?:Einstein
uttam kumar
Ranch Hand

Joined: Jan 27, 2009
Posts: 128

Please ask this question into the JSP or Servlet forum. This forum is for JBoss related questions only.
Nick White Ro

Joined: Jan 27, 2010
Posts: 15
Every request has a header named "User-Agent" that contains information about the user's browser and environment (including operating system).

An example of this header's value is this: "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20101203 Firefox/3.6.13 (.NET CLR 3.5.30729)".

You can get the header value in a servlet using a HttpServletRequest method:

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63844

Be aware that the user-agent is easily spoofed.

[Asking smart questions] [About Bear] [Books by Bear]
Hebert Coelho
Ranch Hand

Joined: Jul 14, 2010
Posts: 754

Bear Bibeault wrote:Be aware that the user-agent is easily spoofed.

And there is a Firefox plugin that does this!

[] [Full WebApplication JSF EJB JPA JAAS with source code to download] One Table Per SubClass [Web/JSF]
I agree. Here's the link:
subject: getting users OS information
It's not a secret anymore!