import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebServlet("/location")
public class LocationServlet extends HttpServlet {
    private Double latitude = 0.0;
    private Double longitude = 0.0;
    private final String BASE_URL = "https://maps.googleapis.com/maps/api/geocode/json?";
    private final String API_KEY = ""; // Insert actual API key to test.

    @Override
    public void doGet(HttpServletRequest request, HttpServletResponse response) {
      
    }

}
@@ -254,25 +254,25 @@
     private 
-D
+d
 ouble latitu
@@ -297,9 +297,9 @@
 ate 
-D
+d
 oubl
@@ -581,14 +581,845 @@
 ) %7B%0A
-
       
+String queryParam = String.format(%22latlng=%251$f,%252$f%22, latitude, longitude);%0A      String apiKeyParam = String.format(%22&key=%25s%22, API_KEY);%0A      String fullPath = BASE_URL + queryParam + apiKeyParam;%0A      try %7B%0A        URL url = new URL(queryPath);%0A        HttpURLConnection connection = (HttpURLConnection) url.openConnection();%0A        connection.setRequestMethod(%22GET%22);%0A        connection.connect();%0A        int responseCode = connection.getResponseCode();%0A        if (responseCode == 200) %7B%0A          String json = getJson(url);%0A          System.out.println(json); // test%0A        %7D else %7B%0A          System.out.println(%22Error: connection response code is: %22 + responseCode);%0A        %7D    %0A      %7D catch(Exception e) %7B%0A        e.printStackTrace();%0A     %7D%0A    %7D%0A%0A    public void getJson() %7B%0A      // TODO: implement this method.
 %0A   

Implement doGet for location servlet (not yet tested.