diff --git a/src/java/com/test/servlets/AuthentifServlet.java b/src/java/com/test/servlets/AuthentifServlet.java index 1e78fd0..e69de29 100644 --- a/src/java/com/test/servlets/AuthentifServlet.java +++ b/src/java/com/test/servlets/AuthentifServlet.java @@ -1,98 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package com.test.servlets; - -import com.test.forms.AuthentifForm; -import java.io.IOException; -import java.io.PrintWriter; -import jakarta.servlet.ServletException; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -/** - * - * @author Dominique_2 - */ -public class AuthentifServlet extends HttpServlet { - - /** - * 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()) { - /* TODO output your page here. You may use following sample code. */ - out.println(""); - out.println(""); - out.println(""); - out.println("Servlet AuthentifServlet"); - out.println(""); - out.println(""); - out.println("

Servlet AuthentifServlet at " + request.getContextPath() + "

"); - out.println(""); - out.println(""); - } - } - - // - /** - * Handles the HTTP GET method. - * - * @param request servlet request - * @param response servlet response - * @throws ServletException if a servlet-specific error occurs - * @throws IOException if an I/O error occurs - */ - @Override - protected void doGet(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException { - //processRequest(request, response); - getServletContext().getRequestDispatcher("/WEB-INF/AuthentificationJSP.jsp").forward(request, response); - } - - /** - * Handles the HTTP POST method. - * - * @param request servlet request - * @param response servlet response - * @throws ServletException if a servlet-specific error occurs - * @throws IOException if an I/O error occurs - */ - @Override - protected void doPost(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException { - // Création de l'objet leControle de type AuthentifForm - AuthentifForm leControle = new AuthentifForm(); - // Appel de la méthode controlerAdmin - boolean isAdmin = leControle.controlerAdmin(request); - // Création de 2 attributs de requête (isAdmin et leControle) - request.setAttribute("isAdmin", isAdmin); - request.setAttribute("controlForm", leControle); - - // Affichage de la JSP - getServletContext().getRequestDispatcher("/WEB-INF/ProfilJSP.jsp") - .forward(request, response); - } - - /** - * Returns a short description of the servlet. - * - * @return a String containing servlet description - */ - @Override - public String getServletInfo() { - return "Short description"; - }// - -} diff --git a/web/WEB-INF/ProfilJSP.jsp b/web/WEB-INF/ProfilJSP.jsp index efcf73b..ab274ae 100644 --- a/web/WEB-INF/ProfilJSP.jsp +++ b/web/WEB-INF/ProfilJSP.jsp @@ -5,15 +5,15 @@
Coordonnées Pompier - - + + - - - - - - + + + + + +
Nom :
Prénom :
Adresse :
Ville :
Code postal :
Téléphone :
Mail :
Statut :
Grade :
Ville :
Code postal :
Téléphone :
Mail :
Statut :
Grade :
Coordonnées Employeur @@ -24,3 +24,6 @@ Mail employeur :
+ + +