Search code examples
javajavascriptjspgoogle-mapsgeocode

How to get country name using geocode?


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?


Solution

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