MapBusesRoute/src/java/rideshare/AllRides_A.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 {
        response.setContentType("text/html;charset=UTF-8");
        try (PrintWriter out = response.getWriter()) {
            String userid = request.getParameter("userid");
            String time = request.getParameter("timestamp");
            RidesUserReturnInfo_A ruri= new  RidesUserReturnInfo_A();
            ArrayList<ArrayList<String>> x=ruri.getRidesInfo(userid, time);
            if (x.size()==0)
            {
                System.out.println("No previous rides");
            response.getWriter().println("No previous rides");
            }
            else{
            AllRideReturn_A arr=new AllRideReturn_A();
            String JsonData=arr.getJson(x);
            System.out.println(JsonData);
            response.getWriter().println(JsonData);}
            /* TODO output your page here. You may use following sample code. */
        }   
    }
protected void processRequest ( HttpServletRequest request , HttpServletResponse response ) throws ServletException , IOException { response . setContentType ( "text/html;charset=UTF-8" ) ; try ( PrintWriter out = response . getWriter ( ) ) { String userid = request . getParameter ( "userid" ) ; String time = request . getParameter ( "timestamp" ) ; RidesUserReturnInfo_A ruri = new RidesUserReturnInfo_A ( ) ; ArrayList < ArrayList < String > > x = ruri . getRidesInfo ( userid , time ) ; if ( x . size ( ) == 0 ) { System . out . println ( "No previous rides" ) ; response . getWriter ( ) . println ( "No previous rides" ) ; } else { AllRideReturn_A arr = new AllRideReturn_A ( ) ; String JsonData = arr . getJson ( x ) ; System . out . println ( JsonData ) ; response . getWriter ( ) . println ( JsonData ) ; } /* TODO output your page here. You may use following sample code. */ } }
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 .