MapBusesRoute/src/java/src/RouteStops.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 {
        ForMumbai fr = new ForMumbai();
        String routenumber = request.getParameter("Route_No");
        ArrayList<MumbaiBusInfo> send1 = fr.main(routenumber);
        ArrayList<com.MumbaiBusRoutesStats> send = new ArrayList<com.MumbaiBusRoutesStats>();
        ArrayList<String> names = new ArrayList<String>();
        ArrayList<String> points = new ArrayList<String>();
        ArrayList<String> routes = new ArrayList<String>();
        for(MumbaiBusInfo m:send1){
            points.add(m.getLat()+","+m.getLng());
            names.add(m.getName());
        }
        for(int i=0; i<points.size()-1; i++){
            routes.add(points.get(i)+"-"+points.get(i+1));
        }
        com.BusStats bb = new com.BusStats();
        try{
            ArrayList<String> result = bb.delhiBusStats(routes, names);
            for(int i=0; i<result.size(); i++){
                String comma[] = result.get(i).split(",");
                com.MumbaiBusRoutesStats m = new com.MumbaiBusRoutesStats(comma[0], Double.parseDouble(comma[1]), Double.parseDouble(comma[2]), comma[3], comma[4], comma[5]);
                System.out.println(comma[0]+"#"+Double.parseDouble(comma[1])+"#"+Double.parseDouble(comma[2])+"#"+comma[3]+"#"+comma[4]+"#"+comma[5]);
                send.add(m);
            }
        }
        catch (Exception e){
            System.out.print(e);
        }
        request.setAttribute("send", send);
        request.setAttribute("city", CitySelect.city);
        request.getRequestDispatcher("BusRoutes.jsp").forward(request, response);
    }
protected void processRequest ( HttpServletRequest request , HttpServletResponse response ) throws ServletException , IOException { ForMumbai fr = new ForMumbai ( ) ; String routenumber = request . getParameter ( "Route_No" ) ; ArrayList < MumbaiBusInfo > send1 = fr . main ( routenumber ) ; ArrayList < com . MumbaiBusRoutesStats > send = new ArrayList < com . MumbaiBusRoutesStats > ( ) ; ArrayList < String > names = new ArrayList < String > ( ) ; ArrayList < String > points = new ArrayList < String > ( ) ; ArrayList < String > routes = new ArrayList < String > ( ) ; for ( MumbaiBusInfo m : send1 ) { points . add ( m . getLat ( ) + "," + m . getLng ( ) ) ; names . add ( m . getName ( ) ) ; } for ( int i = 0 ; i < points . size ( ) - 1 ; i ++ ) { routes . add ( points . get ( i ) + "-" + points . get ( i + 1 ) ) ; } com . BusStats bb = new com . BusStats ( ) ; try { ArrayList < String > result = bb . delhiBusStats ( routes , names ) ; for ( int i = 0 ; i < result . size ( ) ; i ++ ) { String comma [ ] = result . get ( i ) . split ( "," ) ; com . MumbaiBusRoutesStats m = new com . MumbaiBusRoutesStats ( comma [ 0 ] , Double . parseDouble ( comma [ 1 ] ) , Double . parseDouble ( comma [ 2 ] ) , comma [ 3 ] , comma [ 4 ] , comma [ 5 ] ) ; System . out . println ( comma [ 0 ] + "#" + Double . parseDouble ( comma [ 1 ] ) + "#" + Double . parseDouble ( comma [ 2 ] ) + "#" + comma [ 3 ] + "#" + comma [ 4 ] + "#" + comma [ 5 ] ) ; send . add ( m ) ; } } catch ( Exception e ) { System . out . print ( e ) ; } request . setAttribute ( "send" , send ) ; request . setAttribute ( "city" , CitySelect . city ) ; request . getRequestDispatcher ( "BusRoutes.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(routenumber); //System.out.println(routes); //        JSONObject last=new JSONObject(); //        last.put("response", result);