src/java/Controller/PesquisaReservaController.java
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException, SQLException {
        try {
            
            List<Reserva> todasReservas = Reserva.obterReservas();
            
            List<Reserva> reservas = new ArrayList<>(); 
            
            LocalDate hoje = LocalDate.now();
            
            LocalDate dataEstimadaChegada = null;
            
            for(Reserva reserva : todasReservas){
                
                dataEstimadaChegada = reserva.getDataEstimadaChegada();
                
                if(hoje.isEqual(dataEstimadaChegada)){
                    reservas.add(reserva);
                }
                
                if(hoje.isBefore(dataEstimadaChegada)){
                    reservas.add(reserva);
                }
                
            }
           
            request.setAttribute("reservas", reservas);
            RequestDispatcher view = request.getRequestDispatcher("/pesquisaReserva.jsp");
            view.forward(request, response);
        } catch (ClassNotFoundException | SQLException e) {
            throw new ServletException(e);
        }
    }
/**
     * 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
     * @throws java.sql.SQLException
     */
Processes requests for both HTTP GET and POST
methods.


Processes requests for both HTTP GET and POST methods .
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException, SQLException {
        try {
            List<Reserva> todasReservas = Reserva.obterReservas();
            List<Reserva> reservas = new ArrayList<>(); 
            LocalDate hoje = LocalDate.now();
            LocalDate dataEstimadaChegada = null;
            for(Reserva reserva : todasReservas){
                dataEstimadaChegada = reserva.getDataEstimadaChegada();
                if(hoje.isEqual(dataEstimadaChegada)){
                    reservas.add(reserva);
                }
                if(hoje.isBefore(dataEstimadaChegada)){
                    reservas.add(reserva);
                }
            }
            request.setAttribute("reservas", reservas);
            RequestDispatcher view = request.getRequestDispatcher("/pesquisaReserva.jsp");
            view.forward(request, response);
        } catch (ClassNotFoundException | SQLException e) {
            throw new ServletException(e);
        }
    }
protected void processRequest ( HttpServletRequest request , HttpServletResponse response ) throws ServletException , IOException , SQLException { try { List < Reserva > todasReservas = Reserva . obterReservas ( ) ; List < Reserva > reservas = new ArrayList < > ( ) ; LocalDate hoje = LocalDate . now ( ) ; LocalDate dataEstimadaChegada = null ; for ( Reserva reserva : todasReservas ) { dataEstimadaChegada = reserva . getDataEstimadaChegada ( ) ; if ( hoje . isEqual ( dataEstimadaChegada ) ) { reservas . add ( reserva ) ; } if ( hoje . isBefore ( dataEstimadaChegada ) ) { reservas . add ( reserva ) ; } } request . setAttribute ( "reservas" , reservas ) ; RequestDispatcher view = request . getRequestDispatcher ( "/pesquisaReserva.jsp" ) ; view . forward ( request , response ) ; } catch ( ClassNotFoundException | SQLException e ) { throw new ServletException ( e ) ; } }
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 .