aspose file tools*
The moose likes Servlets and the fly likes get location of client? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "get location of client?" Watch "get location of client?" New topic
Author

get location of client?

pawan chopra
Ranch Hand

Joined: Jan 23, 2008
Posts: 408

Hi All,

I have a requirement where I need to fetch location of the client and according to that I need to display weather information.

Can I do this? If yes then kindly let me know.


Pawan Chopra
SCJP - DuMmIeS mInD
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

You can't do it with 100 % accuracy, because a client can be hosted from a server on the other side of the World.

One way is to use one of the "find my IP address" sites, and then find the right location information in the returned source code - another way is to map the clients IP-adr. to a home made database of each IP-adr. groups for the all Countries/Continents of the World.


Regards, Rene Larsen
Dropbox Invite
Abimaran Kugathasan
Ranch Hand

Joined: Nov 04, 2009
Posts: 2066

We can't get the actual location of the client with IP address, He/She may be in local address with NAT.


|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
 
jQuery in Action, 2nd edition
 
subject: get location of client?
 
Similar Threads
How to use put verb with ajax
related to Log4J
Copying a file using http
Prompt for location when file is downloading
Client Location