MapBusesRoute/src/java/src/TrafficUpdate.java
/**
     * 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
     */
Processes requests for both HTTP GET and POST
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
Processes requests for both HTTP GET and POST 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 {
        double clat=0.0;
        double clng=0.0;
        if(CitySelect.city.equals("Delhi"))
        {
            clat=28.6139;
            clng=77.2089;
        }
        if(CitySelect.city.equals("Bangalore"))
        {
            clat=12.9667;
            clng=77.5667;
        }
        if(CitySelect.city.equals("Mumbai"))
        {
            clat=18.9750;
            clng=72.8258;
        }
        TweetDisplay tl=new TweetDisplay();
        FaceBookPostDisplay fbd=new FaceBookPostDisplay();
        ArrayList<TweetInfo> tweetListSend=tl.getTweetDetail();
        ArrayList<FaceBookPostInfo> postListSend=fbd.getPostDetail();
        String tweetHourlyCount=tl.getHourlyCount();
        String postHourlyCount=fbd.getHourlyCount();
        request.setAttribute("tweetHourlyCount", tweetHourlyCount);
        request.setAttribute("postHourlyCount", postHourlyCount);
        request.setAttribute("clat", clat);
        request.setAttribute("clng", clng);
        request.setAttribute("tweetListSend", tweetListSend);
        request.setAttribute("postListSend", postListSend);
        request.setAttribute("city", CitySelect.city);
        if(request.getParameter("daydata")!=null)
        {
        int dayCount=Integer.parseInt(request.getParameter("daydata"));
        System.out.println(dayCount);
        response.setContentType("text/html;charset=UTF-8");
        GetTrafficLocation gtl=new GetTrafficLocation();
        ArrayList<TrafficInfo> atl=gtl.getLoc(dayCount);
        request.setAttribute("atl", atl);
        request.getRequestDispatcher("Mainpage.jsp").forward(request, response);
        }
        else
        {
            int dayCount=0;
              response.setContentType("text/html;charset=UTF-8");
              GetTrafficLocation gtl=new GetTrafficLocation();
              ArrayList<TrafficInfo> atl=gtl.getLoc(dayCount);
              request.setAttribute("atl", atl);
              request.getRequestDispatcher("Mainpage.jsp").forward(request, response);
        }
    }
protected void processRequest ( HttpServletRequest request , HttpServletResponse response ) throws ServletException , IOException { double clat = 0.0 ; double clng = 0.0 ; if ( CitySelect . city . equals ( "Delhi" ) ) { clat = 28.6139 ; clng = 77.2089 ; } if ( CitySelect . city . equals ( "Bangalore" ) ) { clat = 12.9667 ; clng = 77.5667 ; } if ( CitySelect . city . equals ( "Mumbai" ) ) { clat = 18.9750 ; clng = 72.8258 ; } TweetDisplay tl = new TweetDisplay ( ) ; FaceBookPostDisplay fbd = new FaceBookPostDisplay ( ) ; ArrayList < TweetInfo > tweetListSend = tl . getTweetDetail ( ) ; ArrayList < FaceBookPostInfo > postListSend = fbd . getPostDetail ( ) ; String tweetHourlyCount = tl . getHourlyCount ( ) ; String postHourlyCount = fbd . getHourlyCount ( ) ; request . setAttribute ( "tweetHourlyCount" , tweetHourlyCount ) ; request . setAttribute ( "postHourlyCount" , postHourlyCount ) ; request . setAttribute ( "clat" , clat ) ; request . setAttribute ( "clng" , clng ) ; request . setAttribute ( "tweetListSend" , tweetListSend ) ; request . setAttribute ( "postListSend" , postListSend ) ; request . setAttribute ( "city" , CitySelect . city ) ; if ( request . getParameter ( "daydata" ) != null ) { int dayCount = Integer . parseInt ( request . getParameter ( "daydata" ) ) ; System . out . println ( dayCount ) ; response . setContentType ( "text/html;charset=UTF-8" ) ; GetTrafficLocation gtl = new GetTrafficLocation ( ) ; ArrayList < TrafficInfo > atl = gtl . getLoc ( dayCount ) ; request . setAttribute ( "atl" , atl ) ; request . getRequestDispatcher ( "Mainpage.jsp" ) . forward ( request , response ) ; } else { int dayCount = 0 ; response . setContentType ( "text/html;charset=UTF-8" ) ; GetTrafficLocation gtl = new GetTrafficLocation ( ) ; ArrayList < TrafficInfo > atl = gtl . getLoc ( dayCount ) ; request . setAttribute ( "atl" , atl ) ; request . getRequestDispatcher ( "Mainpage.jsp" ) . forward ( request , response ) ; } }
Processes requests for both HTTP <code>GET</code> and <code>POST</code>
 methods.
Processes requests for both HTTP <code > GET< / code > and <code > POST< / code > methods .
//System.out.println(CitySelect.city); //System.out.println(dayCount); //request.getRequestDispatcher("GetRoute").forward(request, response);