File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "get location of client?" Watch "get location of client?" New topic

get location of client?

pawan chopra
Ranch Hand

Joined: Jan 23, 2008
Posts: 415

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
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%|
I agree. Here's the link:
subject: get location of client?
It's not a secret anymore!