0

I want to use geocode to get current country name where the site is loaded.

I have to store country name in session. Also have a JavaScript to find out country name but I used jsp pages so it won't allow to store JavaScript variable in JSP session. In geocode GClientGeocoder() class is there. But how to get address from it?

halfer
  • 19,824
  • 17
  • 99
  • 186
Sonal Patil
  • 217
  • 1
  • 6
  • 16
  • Are you trying to get the end-user's country? I'm not sure GClientGeocoder does that. You might need something like http://www.maxmind.com/app/ip-location or http://hostip.info. Or are you trying to get the country name of an address you have localised to your end users? – Rup Jun 25 '10 at 10:27

2 Answers2

2

Instead of geocode I used Locale class of java in jsp which gives default country.

Sonal Patil
  • 217
  • 1
  • 6
  • 16
0

You use this lib.

Java IP (InetAddress) Locator http://sourceforge.jp/projects/sfnet_javainetlocator/

salyutan
  • 203
  • 1
  • 3
  • 10