permaculture playing cards*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "getting users OS information" Watch "getting users OS information" New topic
Author

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
Greenhorn

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:1.9.2.13) 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
Marshal

Joined: Jan 10, 2002
Posts: 60783
    
  65

Be aware that the user-agent is easily spoofed.


[Asking smart questions] [Bear's FrontMan] [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!

https://addons.mozilla.org/en-US/firefox/addon/user-agent-switcher/


[uaiHebert.com] [Full WebApplication JSF EJB JPA JAAS with source code to download] One Table Per SubClass [Web/JSF]
 
wood burning stoves
 
subject: getting users OS information
 
Similar Threads
How can I show System Information On GUI using AWT/Swing
Java3D extension
Mac and X Code
Mac and X Code
Local OS and Custom registry