Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getting users OS information

 
Abhi Venu
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...??
 
uttam kumar
Ranch Hand
Posts: 128
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please ask this question into the JSP or Servlet forum. This forum is for JBoss related questions only.
 
Nick White Ro
Greenhorn
Posts: 15
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64827
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Be aware that the user-agent is easily spoofed.
 
Hebert Coelho
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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/
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic