This commit is contained in:
clementine.desrucques 2021-10-21 16:23:58 +02:00
parent 1ec492d570
commit a9dec9bae4
2 changed files with 35 additions and 15 deletions

View File

@ -196,6 +196,19 @@ public class PompierMySql {
resultQ.getInt("grade"),
resultQ.getString("commentaire")
);
switch(resultQ.getInt("statut")){
case 1:
setResultat("Pompier");
break;
case 2:
setResultat("Chef");
break;
case 3:
setResultat("Alerte");
break;
}
HttpSession maSession = request.getSession();
maSession.setAttribute("lePompier", lePompier);
}
@ -206,4 +219,8 @@ public class PompierMySql {
return resultat;
}
private void setResultat(String pompier) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
}

View File

@ -9,19 +9,22 @@
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<fieldset>
<legend>Authentification</legend>
<form method="POST" action="Authentification">
<input type="text" name="ztPseudo" placeholder="Pseudo" /><br /><!-- comment -->
<input type="password" name="ztMDP" placeholder="Mot de passe" /><br /><br />
<input type="submit" value="Valider" />
</form>
</fieldset>
<!-- Si l'utilisateur s'est authentifié,
Affichage du message contenu dans l'objet controlForm de type AuthentifForm -->
<p>${controlForm.getResultat()}</p>
<fieldset>
<legend>Authentification</legend>
<form method="POST" action="Authentification">
<input type="text" name="ztPseudo" placeholder="Pseudo" /><br /><!-- comment -->
<input type="password" name="ztMDP" placeholder="Mot de passe" /><br /><br />
<input type="submit" value="Valider" />
</form>
</fieldset>
<br />
<!-- Si l'utilisateur s'est authentifié,
Affichage du message contenu dans l'objet controlForm de type AuthentifForm -->
<p>${controlForm.getResultat()}</p>
<br />
<c:when test="${controlForm.getResultat()=='Chef'}">
<c:redirect url="ChefCaserne"></c:redirect>
</c:when>
<c:when test="${controlForm.getResultat()=='Pompier'}">
<c:redirect url="Pompier"></c:redirect>
</c:when>