protected void processRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        Connexion.setUrl("jdbc:mysql://localhost/rdm?user=root");
        try {
            //Chargement du pilote :
            Class.forName("com.mysql.jdbc.Driver");
        } catch (ClassNotFoundException ex) {
            request.setAttribute("message", "Impossible de charger le pilote");
            RequestDispatcher r = this.getServletContext().getRequestDispatcher("/login.jsp");
            r.forward(request, response);
        }
        
        String action = request.getParameter("action");
        if(Connexion.getInstance()==null){
            request.setAttribute("message", DriverManager.getDrivers() + "pas de connection");
            request.getRequestDispatcher("/index.jsp").forward(request, response);
        }
       
       
        if (action !=null){
            //On redirige les requete a partir d'un array contenant le nom des servlets disponible
            action = action.toLowerCase();
            for(String requestName: 
                    new String[]{
                            "rechercher",
                            "login",
                            "logout",
                            "inscription",
                            "creerreservation",
                            "creerchambre",
                            "supprimerreservation",
                            "supprimerchambre",
                            "modifierreservation",
                            "modifierchambre",
                            "creercompte",
                            "modifiercompte",
                            "supprimercompte",
                             "modifier_rph"}
            )if (requestName.equals(action))
                request.getRequestDispatcher("/"+requestName).forward(request, response);
        }
    }