Merge origin/master
Conflicts: src/java/com/test/forms/AuthentifForm.java web/WEB-INF/PompierJSP.jsp
This commit is contained in:
parent
0f1e30e12e
commit
d4d16b1360
@ -6,12 +6,17 @@
|
||||
package bdd;
|
||||
|
||||
import com.test.beans.Pompier;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpSession;
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import util.MD5;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -19,7 +24,7 @@ import java.util.ArrayList;
|
||||
*/
|
||||
public class PompierMySql {
|
||||
|
||||
private Connection theConnection;
|
||||
private Connection theConnection;
|
||||
private Pompier unPompier;
|
||||
|
||||
/**
|
||||
@ -31,94 +36,163 @@ public class PompierMySql {
|
||||
"admin",// user
|
||||
"minda"); // mot de passe ClientMysql() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creation du pompier passé en paramètre dans la table pompier
|
||||
* Requête non préparée
|
||||
|
||||
/**
|
||||
* Recherche de tous les clients
|
||||
*
|
||||
* @return collection de clients
|
||||
*/
|
||||
public ArrayList<Pompier> readAll() {
|
||||
ArrayList<Pompier> lesPompiers = new ArrayList<>();
|
||||
|
||||
try {
|
||||
Statement stmt = theConnection.createStatement();
|
||||
ResultSet resultQ = null;
|
||||
resultQ = stmt.executeQuery("SELECT * FROM pompier");
|
||||
while (resultQ.next()) {
|
||||
unPompier = new Pompier(resultQ.getInt("id"),
|
||||
resultQ.getInt("idCaserne"),
|
||||
resultQ.getString("nom"),
|
||||
resultQ.getString("prenom"),
|
||||
resultQ.getInt("statut"),
|
||||
resultQ.getString("mail"),
|
||||
resultQ.getString("login"),
|
||||
resultQ.getString("mdp"),
|
||||
resultQ.getInt("adrNo"),
|
||||
resultQ.getString("adrRue"),
|
||||
resultQ.getString("adrCP"),
|
||||
resultQ.getString("adrVille"),
|
||||
resultQ.getInt("grade"),
|
||||
resultQ.getString("commentaire")
|
||||
);
|
||||
lesPompiers.add(unPompier);
|
||||
}
|
||||
resultQ.close();
|
||||
stmt.close();
|
||||
//theConnection.close();
|
||||
} catch (SQLException ex) {
|
||||
System.out.println("SQLException : " + ex.getMessage());
|
||||
System.out.println("SQLState : " + ex.getSQLState());
|
||||
System.out.println("Code erreur : " + ex.getErrorCode());
|
||||
}
|
||||
|
||||
return lesPompiers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creation du pompier passé en paramètre dans la table pompier Requête non
|
||||
* préparée
|
||||
*
|
||||
* @param p objet de type Pompier (sans identifiant)
|
||||
* @return int : id du Pompier créé
|
||||
*/
|
||||
public int create(Pompier p) {
|
||||
int id = -1;
|
||||
try {
|
||||
try {
|
||||
Statement stmt = theConnection.createStatement();
|
||||
int status = stmt.executeUpdate(
|
||||
"INSERT INTO pompier (idCaserne, nom, prenom, statut, mail, login, mdp, adrNo, adrRue, adrCP, adrVille, grade) "
|
||||
+ "VALUES ('" + p.getIdCaserne() + "', '"
|
||||
+ p.getNom() + "', '"
|
||||
+ p.getPrenom() + "', '"
|
||||
+ p.getStatut() + "', "
|
||||
+ p.getMail() + ", '"
|
||||
+ p.getLogin() + ", '"
|
||||
+ p.getMdp() + ", '"
|
||||
+ p.getAdrNo() + ", '"
|
||||
+ p.getAdrRue() + "', '"
|
||||
+ p.getAdrCP() + "', '"
|
||||
+ p.getAdrVille() + "', '"
|
||||
+ p.getGrade()+ "' );",
|
||||
Statement.RETURN_GENERATED_KEYS);
|
||||
|
||||
|
||||
|
||||
"INSERT INTO pompier (idCaserne, nom, prenom, statut, mail, login, mdp, adrNo, adrRue, adrCP, adrVille, grade) "
|
||||
+ "VALUES ('" + p.getIdCaserne() + "', '"
|
||||
+ p.getNom() + "', '"
|
||||
+ p.getPrenom() + "', '"
|
||||
+ p.getStatut() + "', "
|
||||
+ p.getMail() + ", '"
|
||||
+ p.getLogin() + ", '"
|
||||
+ p.getMdp() + ", '"
|
||||
+ p.getAdrNo() + ", '"
|
||||
+ p.getAdrRue() + "', '"
|
||||
+ p.getAdrCP() + "', '"
|
||||
+ p.getAdrVille() + "', '"
|
||||
+ p.getGrade() + "' );",
|
||||
Statement.RETURN_GENERATED_KEYS);
|
||||
|
||||
// Recherche de l'identifiant du pompier créé
|
||||
if (status > 0) {
|
||||
ResultSet result = stmt.getGeneratedKeys();
|
||||
if (result.first()) {
|
||||
id = result.getInt(1);
|
||||
id = result.getInt(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (SQLException ex) {
|
||||
System.out.println("SQLException : " + ex.getMessage());
|
||||
System.out.println("SQLState : " + ex.getSQLState());
|
||||
System.out.println("Code erreur : " + ex.getErrorCode());
|
||||
}
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creation du pompier passé en paramètre dans la table pompier
|
||||
* Requête préparée
|
||||
|
||||
/**
|
||||
* Creation du pompier passé en paramètre dans la table pompier Requête
|
||||
* préparée
|
||||
*
|
||||
* @param p objet de type Pompier (sans identifiant)
|
||||
* @return int : id du pompier créé
|
||||
*/
|
||||
public int createRP(Pompier p) {
|
||||
int id = -1;
|
||||
try {
|
||||
try {
|
||||
PreparedStatement stmt = null;
|
||||
String sql = "INSERT INTO pompier(idCaserne, nom, prenom, statut, mail, login, mdp, adrNo, adrRue, adrCP, adrVille, grade) "
|
||||
+ "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?);";
|
||||
String sql = "INSERT INTO pompier(idCaserne, nom, prenom, statut, mail, login, mdp, adrNo, adrRue, adrCP, adrVille, grade) "
|
||||
+ "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?);";
|
||||
stmt = theConnection.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);
|
||||
stmt.setInt(1, p.getIdCaserne());
|
||||
stmt.setString(2, p.getNom());
|
||||
stmt.setString(2, p.getNom());
|
||||
stmt.setString(3, p.getPrenom());
|
||||
stmt.setInt(4, p.getStatut());
|
||||
stmt.setString(5,p.getMail() );
|
||||
stmt.setString(6,p.getLogin() );
|
||||
stmt.setString(7,p.getMdp() );
|
||||
stmt.setString(5, p.getMail());
|
||||
stmt.setString(6, p.getLogin());
|
||||
stmt.setString(7, p.getMdp());
|
||||
stmt.setInt(8, p.getAdrNo());
|
||||
stmt.setString(9, p.getAdrRue());
|
||||
stmt.setString(10, p.getAdrCP());
|
||||
stmt.setString(11, p.getAdrVille());
|
||||
stmt.setInt(12, p.getGrade());
|
||||
|
||||
|
||||
System.out.println("Requête : " + stmt.toString());
|
||||
int status = stmt.executeUpdate();
|
||||
|
||||
|
||||
|
||||
// Recherche de l'identifiant du client créé
|
||||
if (status > 0) {
|
||||
ResultSet result = stmt.getGeneratedKeys();
|
||||
if (result.first()) {
|
||||
id = result.getInt(1);
|
||||
id = result.getInt(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (SQLException ex) {
|
||||
System.out.println("SQLException : " + ex.getMessage());
|
||||
System.out.println("SQLState : " + ex.getSQLState());
|
||||
System.out.println("Code erreur : " + ex.getErrorCode());
|
||||
}
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
public boolean isAuthentified(HttpServletRequest request) {
|
||||
|
||||
boolean resultat = false;
|
||||
String login = request.getParameter("ztPseudo");
|
||||
String mdp = request.getParameter("ztMDP");
|
||||
String mdpChiffre = MD5.encode(request.getParameter("ztMDP"));
|
||||
String sql = "SELECT * FROM pompier WHERE login='" + login + "' AND mdp='" + mdpChiffre + "';";
|
||||
System.out.println("sql:"+sql);
|
||||
try {
|
||||
Statement stmt = theConnection.createStatement();
|
||||
ResultSet resultQ = null;
|
||||
resultQ = stmt.executeQuery(sql);
|
||||
resultat = (resultQ.next());
|
||||
// if(resultat){
|
||||
// Pompier lePompier = new Pompier(
|
||||
// resultQ.getInt("id"),
|
||||
// resultQ.getInt("idCAserne"),
|
||||
//
|
||||
// );
|
||||
// HttpSession maSession = request.getSession();
|
||||
// maSession.setAttribute("lePompier", lePompier);
|
||||
// }
|
||||
|
||||
} catch (SQLException ex) {
|
||||
Logger.getLogger(PompierMySql.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
return resultat;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -25,13 +25,14 @@ public class Pompier {
|
||||
private String adrCP;
|
||||
private String adrVille;
|
||||
private int grade;
|
||||
private String commentaire;
|
||||
|
||||
public Pompier(int id, int idCaserne, String nom, String prenom, int statut, String mail, String login, String mdp, int adrNo, String adrRue, String adrCP, String adrVille, int grade) {
|
||||
this(idCaserne, nom, prenom, statut, mail, login, mdp, adrNo, adrRue, adrCP, adrVille, grade);
|
||||
public Pompier(int id, int idCaserne, String nom, String prenom, int statut, String mail, String login, String mdp, int adrNo, String adrRue, String adrCP, String adrVille, int grade, String commentaire) {
|
||||
this(idCaserne, nom, prenom, statut, mail, login, mdp, adrNo, adrRue, adrCP, adrVille, grade, commentaire);
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Pompier(int idCaserne, String nom, String prenom, int statut, String mail, String login, String mdp, int adrNo, String adrRue, String adrCP, String adrVille, int grade) {
|
||||
|
||||
public Pompier(int idCaserne, String nom, String prenom, int statut, String mail, String login, String mdp, int adrNo, String adrRue, String adrCP, String adrVille, int grade, String commentaire) {
|
||||
this.idCaserne = idCaserne;
|
||||
this.nom = nom;
|
||||
this.prenom = prenom;
|
||||
@ -44,9 +45,9 @@ public class Pompier {
|
||||
this.adrCP = adrCP;
|
||||
this.adrVille = adrVille;
|
||||
this.grade = grade;
|
||||
this.commentaire = commentaire;
|
||||
}
|
||||
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
@ -151,9 +152,17 @@ public class Pompier {
|
||||
this.grade = grade;
|
||||
}
|
||||
|
||||
public String getCommentaire() {
|
||||
return commentaire;
|
||||
}
|
||||
|
||||
public void setCommentaire(String commentaire) {
|
||||
this.commentaire = commentaire;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 7;
|
||||
int hash = 3;
|
||||
hash = 29 * hash + this.id;
|
||||
hash = 29 * hash + this.idCaserne;
|
||||
hash = 29 * hash + Objects.hashCode(this.nom);
|
||||
@ -167,6 +176,7 @@ public class Pompier {
|
||||
hash = 29 * hash + Objects.hashCode(this.adrCP);
|
||||
hash = 29 * hash + Objects.hashCode(this.adrVille);
|
||||
hash = 29 * hash + this.grade;
|
||||
hash = 29 * hash + Objects.hashCode(this.commentaire);
|
||||
return hash;
|
||||
}
|
||||
|
||||
@ -221,13 +231,17 @@ public class Pompier {
|
||||
if (!Objects.equals(this.adrVille, other.adrVille)) {
|
||||
return false;
|
||||
}
|
||||
if (!Objects.equals(this.commentaire, other.commentaire)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Pompier{" + "id=" + id + ", idCaserne=" + idCaserne + ", nom=" + nom + ", prenom=" + prenom + ", statut=" + statut + ", mail=" + mail + ", login=" + login + ", mdp=" + mdp + ", adrNo=" + adrNo + ", adrRue=" + adrRue + ", adrCP=" + adrCP + ", adrVille=" + adrVille + ", grade=" + grade + '}';
|
||||
return "Pompier{" + "id=" + id + ", idCaserne=" + idCaserne + ", nom=" + nom + ", prenom=" + prenom + ", statut=" + statut + ", mail=" + mail + ", login=" + login + ", mdp=" + mdp + ", adrNo=" + adrNo + ", adrRue=" + adrRue + ", adrCP=" + adrCP + ", adrVille=" + adrVille + ", grade=" + grade + ", commentaire=" + commentaire + '}';
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -5,6 +5,7 @@
|
||||
*/
|
||||
package com.test.forms;
|
||||
|
||||
import bdd.PompierMySql;
|
||||
import com.test.beans.Pompier;
|
||||
import com.test.beans.UserP;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
@ -40,12 +41,18 @@ public class AuthentifForm {
|
||||
*/
|
||||
|
||||
public boolean controlerRole(HttpServletRequest request) {
|
||||
|
||||
|
||||
|
||||
/* Comparaison entre l'utilisateur saisi et un utilisateur de la base de donées */
|
||||
// UserP ChefCaserne = new UserP("Michel", "mRANN");
|
||||
|
||||
|
||||
|
||||
PompierMySql pm = new PompierMySql();
|
||||
boolean resul = pm.isAuthentified(request);
|
||||
resultat = resul?"":"Pseudo ou mdp incorrect";
|
||||
return resul;
|
||||
// Mise à jour de l'attribut resultat
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -46,8 +46,8 @@ public class NouveauPompForm {
|
||||
if (erreur > 0) return -1;
|
||||
|
||||
// Creation d'un objet de type Client avec les données transmises
|
||||
String mdpChiffre = MD5.encode(request.getParameter("ztMDP"));
|
||||
Pompier unPompier = new Pompier (request.getParameter("id"),
|
||||
|
||||
Pompier unPompier = new Pompier(request.getParameter("id"),
|
||||
request.getParameter("idCaserne"),
|
||||
request.getParameter("ztNom"),
|
||||
request.getParameter("ztPrenom"),
|
||||
@ -59,7 +59,8 @@ public class NouveauPompForm {
|
||||
request.getParameter("ztAdrRue"),
|
||||
request.getParameter("ztAdrCP"),
|
||||
request.getParameter("ztAdrVille"),
|
||||
request.getParameter("nGrade")
|
||||
request.getParameter("nGrade"),
|
||||
request.getParameter("commentaire")
|
||||
);
|
||||
PompierMySql cm = new PompierMySql();
|
||||
int id = cm.createRP(unPompier); // Requête préparée
|
||||
|
@ -57,6 +57,8 @@ public class ModifPompierServlet extends HttpServlet {
|
||||
@Override
|
||||
protected void doGet(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException {
|
||||
PompierMysql PompierMs = new PompierMySql();
|
||||
request.setAttribute("unPompier", PomperMs.readAll());
|
||||
processRequest(request, response);
|
||||
}
|
||||
|
||||
|
@ -78,18 +78,18 @@ public class authentifServlet extends HttpServlet {
|
||||
// Création de l'objet leControle de type AuthentifForm
|
||||
AuthentifForm leControle = new AuthentifForm();
|
||||
// Appel de la méthode controlerRole
|
||||
boolean isChef = leControle.controlerRole(request);
|
||||
boolean isAuthentified = leControle.controlerRole(request);
|
||||
// Création de 2 attributs de requête (isChef et leControle)
|
||||
request.setAttribute("isChef", isChef);
|
||||
request.setAttribute("isAuthentified", isAuthentified);
|
||||
request.setAttribute("controlForm", leControle);
|
||||
HttpSession maSession = request.getSession();
|
||||
maSession.setAttribute("isAuthentified", true);
|
||||
// Affichage de la JSP
|
||||
if(isChef==true){
|
||||
getServletContext().getRequestDispatcher("/WEB-INF/ChefCaserneJSP.jsp")
|
||||
if(isAuthentified==true){
|
||||
getServletContext().getRequestDispatcher("/WEB-INF/PompierJSP.jsp")
|
||||
.forward(request, response);
|
||||
}else{
|
||||
getServletContext().getRequestDispatcher("/WEB-INF/PompierJSP.jsp")
|
||||
getServletContext().getRequestDispatcher("/WEB-INF/accueilJSP.jsp")
|
||||
.forward(request, response);
|
||||
}
|
||||
|
||||
|
@ -5,6 +5,7 @@
|
||||
--%>
|
||||
<%@include file = "jspf/enteteJSPF.jspf" %>
|
||||
<%@page contentType="text/html" pageEncoding="UTF-8"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
@ -48,7 +49,7 @@
|
||||
<td><c:out value="${unPompier.getAdrCP()}"/></td>
|
||||
<td><c:out value="${unPompier.getAdrVille()}"/></td>
|
||||
<td><c:out value="${unPompier.getGrade()}"/></td>
|
||||
<td><c:out value="${unPompier.getCom()}"/></td>
|
||||
<td><c:out value="${unPompier.getCommentaire()}"/></td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
|
||||
|
@ -5,6 +5,7 @@
|
||||
--%>
|
||||
<%@include file = "jspf/enteteJSPF.jspf" %>
|
||||
<%@page contentType="text/html" pageEncoding="UTF-8"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
@ -17,44 +18,42 @@
|
||||
<legend>Fiche Pompier</legend>
|
||||
<form name="fPompier" method="POST" action="ModifPompier">
|
||||
<label for="nIdCaserne">Id Caserne : </label>
|
||||
<input type="number" name="nIdCaserne"/><br /><br/>
|
||||
<input type="number" name="nIdCaserne" <c:out value="${unPompier.getIdCaserne()}"/><br /><br/>
|
||||
<label for="ztNom">Nom : </label>
|
||||
<input type="text" name="ztNom" placeholder="Nom" /><br /><br/>
|
||||
<input type="text" name="ztNom" placeholder="Nom" <c:out value="${unPompier.getNom()}"/><br /><br/>
|
||||
<label for="ztPrenom">Prénom : </label>
|
||||
<input type="text" name="ztPrenom" placeholder="Prénom"/><br /><br/>
|
||||
<input type="text" name="ztPrenom" placeholder="Prénom" <c:out value="${unPompier.getPrenom()}"/><br /><br/>
|
||||
<label for="nStatut">Numéro de statut : </label>
|
||||
<input type="number" name="nStatut"/><br /><br/>
|
||||
<input type="number" name="nStatut" <c:out value="${unPompier.getStatut()}"/><br /><br/>
|
||||
<label for="eMail">Mail : </label>
|
||||
<input type="email" name="eMail"/><br /><br/>
|
||||
<input type="email" name="eMail"<c:out value="${unPompier.getAdrmail()}"/> <br /><br/>
|
||||
<label for="ztLogin">Login : </label>
|
||||
<input type="text" name="ztLogin" placeholder="Login"/><br /><br/>
|
||||
<input type="text" name="ztLogin" placeholder="Login"<c:out value="${unPompier.getLogin()}"/><br /><br/>
|
||||
<label for="ztMDP">Mot de passe : </label>
|
||||
<input type="password" name="ztMDP" placeholder="Mot de passe" /><br /><br />
|
||||
<input type="password" name="ztMDP" placeholder="Mot de passe" <c:out value="${unPompier.getMdp()}"/><br /><br />
|
||||
<label for="nAdrNo">Numéro de rue : </label>
|
||||
<input type="number" name="nAdrNo"/><br /><br/>
|
||||
<input type="number" name="nAdrNo"<br <c:out value="${unPompier.getAdrNo()}"/> <br/>
|
||||
<label for="ztAdrRue">Nom de la rue : </label>
|
||||
<input type="text" name="ztAdrRue" placeholder="Rue" /><br /><br/>
|
||||
<input type="text" name="ztAdrRue" placeholder="Rue" <c:out value="${unPompier.getAdrRue()}"/><br /><br/>
|
||||
<label for="ztAdrCP">Code postal : </label>
|
||||
<input type="text" name="ztAdrCP" placeholder="Code postal" /><br /><br/>
|
||||
<input type="text" name="ztAdrCP" placeholder="Code postal" <c:out value="${unPompier.getAdrCP()}"/><br /><br/>
|
||||
<label for="ztAdrVille">Ville : </label>
|
||||
<input type="text" name="ztAdrVille" placeholder="Ville" /><br /><br/>
|
||||
<input type="text" name="ztAdrVille" placeholder="Ville" <c:out value="${unPompier.getAdrVille()}"/><br /><br/>
|
||||
<label for="nGrade">Numéro de grade : </label>
|
||||
<input type="number" name="nGrade"/><br /><br/>
|
||||
<input type="number" name="nGrade"<c:out value="${unPomier.getGrade()}"/></td><br /><br/>
|
||||
<input type="submit" value="Valider" />
|
||||
</form>
|
||||
</fieldset>
|
||||
<c:out value="${unPompier.getIdCaserne()}"/></td>
|
||||
<c:out value="${unPompier.getNom()}"/>
|
||||
<c:out value="${unPompier.getPrenom()}"/>
|
||||
<c:out value="${unPompier.getStatut()}"/>
|
||||
<c:out value="${unPompier.getAdrmail()}"/>
|
||||
<c:out value="${unPompier.getLogin()}"/>
|
||||
<c:out value="${unPompier.getMdp()}"/>
|
||||
<c:out value="${unPompier.getAdrNo()}"/>
|
||||
<c:out value="${unPompier.getAdrRue()}"/>
|
||||
<c:out value="${unPompier.getAdrCP()}"/>
|
||||
<c:out value="${unPompier.getAdrVille()}"/>
|
||||
<c:out value="${unPomier.getGrade()}"/></td>
|
||||
</fieldset>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -8,12 +8,7 @@
|
||||
<%@page import="com.test.forms.AuthentifForm" %>
|
||||
<%@page contentType="text/html" pageEncoding="UTF-8"%>
|
||||
|
||||
<!-- Message de bienvenue personnalisé -->
|
||||
<p>Bienvenue <c:out value="${param.ztPseudo}" /></p>
|
||||
${empty param.ztPseudo ? "Veuillez vous authentifier" : "Authentification réussie"}
|
||||
<!-- Affichage du formulaire si l'utilisateur ne s'est pas encore authentifié -->
|
||||
<c:choose>
|
||||
<c:when test="${empty param.ztPseudo}">
|
||||
|
||||
<fieldset>
|
||||
<legend>Authentification</legend>
|
||||
<form method="POST" action="Authentification">
|
||||
@ -22,13 +17,11 @@ ${empty param.ztPseudo ? "Veuillez vous authentifier" : "Authentification réuss
|
||||
<input type="submit" value="Valider" />
|
||||
</form>
|
||||
</fieldset>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
|
||||
<!-- Si l'utilisateur s'est authentifié,
|
||||
Affichage du message contenu dans l'objet controlForm de type AuthentifForm -->
|
||||
|
||||
<p>${controlForm.getResultat()}</p>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
|
||||
|
||||
<br />
|
Loading…
x
Reference in New Issue
Block a user