/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package twitservlets;

import com.google.gson.Gson;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Map;
import javax.json.Json;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import model.SearchTweets;

/**
 *
 * @author user
 */
public class setcurrentlocation extends HttpServlet {

    /**
     * Processes requests for both HTTP <code>GET</code> and <code>POST</code>
     * methods.
     *
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        response.setContentType("text/html;charset=UTF-8");
        try (PrintWriter out = response.getWriter()) {
            /* TODO output your page here. You may use following sample code. */
            String lat=request.getParameter("latitude");
            String longi=request.getParameter("longitude");
            System.out.println("map.setcurrentlocation.processRequest()");
            System.out.println(lat+""+longi);
            Object trend=SearchTweets.returnTrend(Double.parseDouble(lat),Double.parseDouble(longi));
                        System.out.println(trend);

            //out.println("ashutosh");
            out.println(trend);
        }
    }

    // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
    /**
     * Handles the HTTP <code>GET</code> method.
     *
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        processRequest(request, response);
    }

    /**
     * Handles the HTTP <code>POST</code> method.
     *
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        processRequest(request, response);
    }

    /**
     * Returns a short description of the servlet.
     *
     * @return a String containing servlet description
     */
    @Override
    public String getServletInfo() {
        return "Short description";
    }// </editor-fold>

}

@@ -580,39 +580,10 @@
 %0D%0A%0D%0A
-/**%0D%0A *%0D%0A * @author user%0D%0A */
 %0D%0A
+
 publ
@@ -641,326 +641,8 @@
 %0D%0A  
-  /**%0D%0A     * Processes requests for both HTTP %3Ccode%3EGET%3C/code%3E and %3Ccode%3EPOST%3C/code%3E%0D%0A     * methods.%0D%0A     *%0D%0A     * @param request servlet request%0D%0A     * @param response servlet response%0D%0A     * @throws ServletException if a servlet-specific error occurs%0D%0A     * @throws IOException if an I/O error occurs%0D%0A     */
 %0D%0A  
@@ -916,77 +916,8 @@
     
- /* TODO output your page here. You may use following sample code. */
 %0D%0A  
@@ -1309,24 +1309,24 @@
 (trend);%0D%0A%0D%0A
+
             
@@ -1327,36 +1327,8 @@
     
-  //out.println(%22ashutosh%22);
 %0D%0A  

Update setcurrentlocation.java