my dog learned polymorphism*
The moose likes Other JSE/JEE APIs and the fly likes API to get Browser from UserAgent string Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "API to get Browser from UserAgent string" Watch "API to get Browser from UserAgent string" New topic
Author

API to get Browser from UserAgent string

Carlos Araujo
Greenhorn

Joined: Nov 24, 2008
Posts: 2
Hi!

I'm trying to port an PHP application to Java, but I can't find any API to get the browser's name, version and OS, from the UserAgent string.
Ive tried to use this http://turbine.apache.org/turbine/development/turbine-2.4/apidocs/org/apache/turbine/util/BrowserDetector.html , but it doesn't detect bots and it's not very "smart".
Can anoyne point me to some API so I can import in project to be able to do this?

Best regards
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19651
    
  18

I take it that with "Java" you mean JSP or servlets?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Carlos Araujo
Greenhorn

Joined: Nov 24, 2008
Posts: 2
Hi!

Actually it's a Desktop application, that parses Apache Logs.
In those logs I have the "user agent strings"(http://www.useragentstring.com/pages/useragentstring.php) like:

And I would like to have a Class or static methods where I could pass as argument the UserAgentString and get browser name, version and OS.
Could try to implement this, but this is common so I would like to know if there's already implemented.

Best regards
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: API to get Browser from UserAgent string
 
Similar Threads
Access Control List, ACL's, Websphere
How to access Another servlet's Response Object
Want to add code in my jsp file.
storing xml fields into variables
Access Control List, ACL's