Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » How to obtain country of a client connection?
How to obtain country of a client connection? [message #1803160] Sun, 24 February 2019 08:04 Go to next message
David Lee is currently offline David LeeFriend
Messages: 52
Registered: May 2013
Member
Hi,

When a user connects a RAP web application, how to obtain the client information, such as from which country?

Thank you!

David

[Updated on: Sun, 24 February 2019 08:06]

Report message to a moderator

Re: How to obtain country of a client connection? [message #1803176 is a reply to message #1803160] Sun, 24 February 2019 19:30 Go to previous messageGo to next message
Chris Fairhall is currently offline Chris FairhallFriend
Messages: 221
Registered: February 2011
Senior Member
RWT.getRequest returns an HttpServletRequest
From there it's up to you to determine the IP address and from there, the country.
Re: How to obtain country of a client connection? [message #1803465 is a reply to message #1803176] Fri, 01 March 2019 07:19 Go to previous messageGo to next message
David Lee is currently offline David LeeFriend
Messages: 52
Registered: May 2013
Member
Hi,Chris,

Thank you for reply!
Yes, I knew RWT.getRequest().getRemoteAddr() can get the client IP, is there a way to directly get the "country of the connected client" from the RWT/RAP api without any other 3rd party?
Re: How to obtain country of a client connection? [message #1803539 is a reply to message #1803465] Sun, 03 March 2019 19:10 Go to previous message
Chris Fairhall is currently offline Chris FairhallFriend
Messages: 221
Registered: February 2011
Senior Member
No, that requires a database to map IP addresses to countries.
If you wish to do this for locale reasons, you can check the Accept-Language header
Previous Topic:Password Text field, RAP 3.7, Firefox 65
Next Topic:check size and format before FileUpload
Goto Forum:
  


Current Time: Sun Dec 08 22:30:19 GMT 2019

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

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

Back to the top