1

<% System.getProperty("os.name") %> can be used to identify the OS name running in the server machine. But how can i identify the OS information in the client machine using java in a web application?

4 Answers 4

3

You can't. The browser doesn't send detailed OS information to web servers.

You can do some wild guess from the user-agent but that's not accurate at all.

Sign up to request clarification or add additional context in comments.

2 Comments

yes they do you can see stat in Google Analytics it show alot of data of client and only by javascript code so this can be done
If you run software on client (including Javascript), it's a totally different issue. Some website can even fetch your computer serial number with ActiveX but I guess that's not the original question.
2

You'd have to use javascript or other client-side technology to find out. Then, send it back to the server throuht http.

Comments

0

You can have some information in HTTP headers, such as User-Agent.

1 Comment

User-Agent gives the OS name. But it does not give the specific name and version. For example, it will say 'Windows NT' even for Windows 2000 and Windows XP. But I want to identify the exact version.
0

if you can use javascript you can simply find the navigator.appVersion and use it to determine the OS like if the appVersions is Windows 5.0, this means that the system is using Windows XP.

1 Comment

System.getProperty("os.name") returns the server's os name

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.