PrintWriter outprint = Response.getwriter (); String lat = "39.983424"; Latitude//string lng = "116.322987";
Longitude String LNG = request.getparameter ("Jingdu");
String lat = request.getparameter ("Weidu");
Outprint.print (LNG + ";" + lat); try{url url = new URL ("Http://api.map.baidu.com/geocoder/v2/?ak=wPPxsfCtNFm4PqEV68jbDdjP7U4twstj&callbac
k=renderreverse&location= "+ Lat +", "+ LNG +" &output=json&pois=1 ");
HttpURLConnection Ucon = (httpurlconnection) url.openconnection ();
Ucon.connect ();
InputStream in = Ucon.getinputstream ();
BufferedReader reader = new BufferedReader (new InputStreamReader (in, "UTF-8"));
String str = reader.readline ();
Outprint.print (str);
str = str.substring (Str.indexof ("(") + 1, str.length ()-1);
Outprint.print (str);
Jsonobject jsonobject = new Jsonobject (str); String address = "";
Address = Jsonobject.getjsonobject ("result"). GetString ("formatted_address");
Outprint.print (address);
Outprint.close ();
Outprint=null;
}catch (Exception e) {e.printstacktrace (); }