views:

88

answers:

2

Hi everyone,

Please tell me how 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 wont allow to store javascript varialble in JSP session.Plaese if anyone knows answer help me.In geocode GClientGeocoder() class is there.But how to get address from it?

A: 

You use this lib.

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

salyutan
A: 

Hi, Instead of geocode I used Locale class of java in jsp which gives default country. <%@ page import="java.util.*;" %> <%@ page language="java" %> <% String countryName=Locale.getDefault().getDisplayCountry(); session.setAttribute("locale",countryName);%>

Sonal Patil