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 00:31 Go to next message
Ronald So is currently offline Ronald So
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 01:45 Go to previous messageGo to next message
Markus Duft is currently offline Markus Duft
Messages: 60
Registered: February 2013
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 11:37 Go to previous messageGo to next message
Ronald So is currently offline Ronald So
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 05:28 Go to previous messageGo to next message
Markus Duft is currently offline Markus Duft
Messages: 60
Registered: February 2013
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 11:22 Go to previous messageGo to next message
Ronald So is currently offline Ronald So
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 01:35 Go to previous message
Markus Duft is currently offline Markus Duft
Messages: 60
Registered: February 2013
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: Wed Apr 16 06:47:53 EDT 2014

Powered by FUDForum. Page generated in 0.01713 seconds