diff --git a/src/java/bdd/PompierMysql.java b/src/java/bdd/PompierMysql.java index 74381f4..52f1006 100644 --- a/src/java/bdd/PompierMysql.java +++ b/src/java/bdd/PompierMysql.java @@ -155,5 +155,5 @@ public class PompierMysql { } return id; } - + } diff --git a/src/java/com/test/servlets/AuthentifServlet.java b/src/java/com/test/servlets/AuthentifServlet.java index 80ed961..1e78fd0 100644 --- a/src/java/com/test/servlets/AuthentifServlet.java +++ b/src/java/com/test/servlets/AuthentifServlet.java @@ -5,6 +5,7 @@ */ package com.test.servlets; +import com.test.forms.AuthentifForm; import java.io.IOException; import java.io.PrintWriter; import jakarta.servlet.ServletException; @@ -71,7 +72,17 @@ public class AuthentifServlet extends HttpServlet { @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - processRequest(request, response); + // 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); } /** diff --git a/src/java/com/test/servlets/ProfilServlet.java b/src/java/com/test/servlets/ProfilServlet.java index ebd94ec..f170de7 100644 --- a/src/java/com/test/servlets/ProfilServlet.java +++ b/src/java/com/test/servlets/ProfilServlet.java @@ -35,10 +35,10 @@ public class ProfilServlet extends HttpServlet { out.println(""); out.println(""); out.println(""); - out.println("Servlet Profil"); + out.println("Servlet ProfilServlets"); out.println(""); out.println(""); - out.println("

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

"); + out.println("

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

"); out.println(""); out.println(""); } @@ -70,9 +70,9 @@ public class ProfilServlet extends HttpServlet { */ @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - processRequest(request, response); + throws ServletException, IOException { + getServletContext().getRequestDispatcher("/WEB-INF/ProfilJSP.jsp") + .forward(request, response); } /** diff --git a/web/WEB-INF/AuthentificationJSP.jsp b/web/WEB-INF/AuthentificationJSP.jsp index c169255..a837d3c 100644 --- a/web/WEB-INF/AuthentificationJSP.jsp +++ b/web/WEB-INF/AuthentificationJSP.jsp @@ -1,9 +1,13 @@ <%-- Document : authentificationJSP Created on : 18 oct. 2021, 11:09:26 - Author : Chelloug.Eliass + Author : Millot.Thomas --%> <%@include file="jspf/enteteJSPF.jspf" %> +<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@page import="com.test.forms.AuthentifForm" %> + +

Merci de vous identifier pour acceder aux dossiers

@@ -12,11 +16,11 @@
Identification utilisateur

- +

- +



@@ -32,5 +36,4 @@

- - + diff --git a/web/WEB-INF/ModifProfilJSP.jsp b/web/WEB-INF/ModifProfilJSP.jsp index f85a6a3..b4df2f8 100644 --- a/web/WEB-INF/ModifProfilJSP.jsp +++ b/web/WEB-INF/ModifProfilJSP.jsp @@ -1,7 +1,7 @@ <%-- Document : ModifProfilJSP Created on : 18 oct. 2021, 11:10:01 - Author : Chelloug.Eliass + Author : Millot.thomas --%> <%@page contentType="text/html" pageEncoding="UTF-8"%> diff --git a/web/WEB-INF/ProfilJSP.jsp b/web/WEB-INF/ProfilJSP.jsp index 9b49d8b..ff4dcbb 100644 --- a/web/WEB-INF/ProfilJSP.jsp +++ b/web/WEB-INF/ProfilJSP.jsp @@ -1,9 +1,3 @@ -<%-- - Document : authentificationJSP - Created on : 18 oct. 2021, 11:09:26 - Author : Chelloug.Eliass ---%> -<%@include file="jspf/enteteJSPF.jspf" %>

Merci de vous identifier pour acceder aux dossiers