Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Checking Browser type & Version Number
Checking Browser type & Version Number [message #1015791] Sun, 03 March 2013 05:31 Go to next message
Ronald So is currently offline Ronald SoFriend
Messages: 198
Registered: April 2011
Senior Member
Hi,

I realized that we can issue this call to get some header information of the HttpServletRequest.

RWT.getRequest().getHeader("User-agent");


And these are two examples of return.

Mozilla/5.0 (X11; Linux x86_64; rv:10.0.5) Gecko/20120606 Firefox/10.0.5
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5


Is there a reliable way (such as other API calls) to retrieve the browser version number other than parsing the string above?

Thanks,
Ronald
Re: Checking Browser type & Version Number [message #1015879 is a reply to message #1015791] Mon, 04 March 2013 06:45 Go to previous messageGo to next message
Markus Duft is currently offline Markus DuftFriend
Messages: 145
Registered: February 2013
Senior Member
AFAICT there is no other way. We detect browsers by matching versions in the string Wink
Re: Checking Browser type & Version Number [message #1016035 is a reply to message #1015879] Mon, 04 March 2013 16:37 Go to previous messageGo to next message
Ronald So is currently offline Ronald SoFriend
Messages: 198
Registered: April 2011
Senior Member
Alright. Thanks Markus!

Apologize to the board about the repeated messages that got posted in the forum. I swear that I only hit the submit button once!!! Sad

Regards,
Ronald
Re: Checking Browser type & Version Number [message #1016167 is a reply to message #1016035] Tue, 05 March 2013 10:28 Go to previous messageGo to next message
Markus Duft is currently offline Markus DuftFriend
Messages: 145
Registered: February 2013
Senior Member
Quote:

Alright. Thanks Markus!


If you're interested, i use the attached class to validate.

Quote:

Apologize to the board about the repeated messages that got posted in the forum. I swear that I only hit the submit button once!!!


haha, thats web applications, right? Very Happy
Re: Checking Browser type & Version Number [message #1016254 is a reply to message #1016167] Tue, 05 March 2013 16:22 Go to previous messageGo to next message
Ronald So is currently offline Ronald SoFriend
Messages: 198
Registered: April 2011
Senior Member
If I ever have a chance to meet you in real life (future EclipseCon maybe?), Markus, your drinks are on me. Big thank you!
Re: Checking Browser type & Version Number [message #1016340 is a reply to message #1016254] Wed, 06 March 2013 06:35 Go to previous message
Markus Duft is currently offline Markus DuftFriend
Messages: 145
Registered: February 2013
Senior Member
Haha, not a problem at all Smile Always great if i can help Wink
Previous Topic:RAP nightly download link
Next Topic:RWT ServiceManager
Goto Forum:
  


Current Time: Fri Dec 19 17:29:46 GMT 2014

Powered by FUDForum. Page generated in 0.16222 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software