Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

[ ADF, JDev12.1.3 ] How to detect browser/platform infos?

FlattitNov 4 2015 — edited Nov 4 2015

Hallo,


I would need to retrieve the infos of the client browser/platform.


In PHP I use the global  var...

$_SERVER['HTTP_USER_AGENT']


... that return a value like this:


Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.57 Safari/537.36


To get the same infos in my ADF application I used this code that I created following this tutorial of Ashish Awasthi's Blog (Jdev/ADF): Detect browser & platform information (name,version), server and client IP details in … of @"Ashish Awasthi"


    clientBrowser =

      FacesUtils.getAgentInfo().getAgentName() + " v. " + FacesUtils.getAgentInfo().getAgentVersion() + " - " +

      FacesUtils.getAgentInfo().getPlatformName() + " v. " + FacesUtils.getAgentInfo().getPlatformVersion();

The returned value is:

webkit v. 537.36 - windows v. unknown

I'd like to know if that is the max infos we can get in Java or if there is also another apporach to follow to get more details.

Thanks,

Federico

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 2 2015
Added on Nov 4 2015
5 comments
1,301 views