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;
|
package bdd;
|
||||||
|
|
||||||
import com.test.beans.Pompier;
|
import com.test.beans.Pompier;
|
||||||
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
import jakarta.servlet.http.HttpSession;
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.sql.Statement;
|
import java.sql.Statement;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
import util.MD5;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -33,8 +38,51 @@ public class PompierMySql {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creation du pompier passé en paramètre dans la table pompier
|
* Recherche de tous les clients
|
||||||
* Requête non préparée
|
*
|
||||||
|
* @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)
|
* @param p objet de type Pompier (sans identifiant)
|
||||||
* @return int : id du Pompier créé
|
* @return int : id du Pompier créé
|
||||||
*/
|
*/
|
||||||
@ -55,11 +103,9 @@ public class PompierMySql {
|
|||||||
+ p.getAdrRue() + "', '"
|
+ p.getAdrRue() + "', '"
|
||||||
+ p.getAdrCP() + "', '"
|
+ p.getAdrCP() + "', '"
|
||||||
+ p.getAdrVille() + "', '"
|
+ p.getAdrVille() + "', '"
|
||||||
+ p.getGrade()+ "' );",
|
+ p.getGrade() + "' );",
|
||||||
Statement.RETURN_GENERATED_KEYS);
|
Statement.RETURN_GENERATED_KEYS);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Recherche de l'identifiant du pompier créé
|
// Recherche de l'identifiant du pompier créé
|
||||||
if (status > 0) {
|
if (status > 0) {
|
||||||
ResultSet result = stmt.getGeneratedKeys();
|
ResultSet result = stmt.getGeneratedKeys();
|
||||||
@ -76,8 +122,9 @@ public class PompierMySql {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creation du pompier passé en paramètre dans la table pompier
|
* Creation du pompier passé en paramètre dans la table pompier Requête
|
||||||
* Requête préparée
|
* préparée
|
||||||
|
*
|
||||||
* @param p objet de type Pompier (sans identifiant)
|
* @param p objet de type Pompier (sans identifiant)
|
||||||
* @return int : id du pompier créé
|
* @return int : id du pompier créé
|
||||||
*/
|
*/
|
||||||
@ -92,9 +139,9 @@ public class PompierMySql {
|
|||||||
stmt.setString(2, p.getNom());
|
stmt.setString(2, p.getNom());
|
||||||
stmt.setString(3, p.getPrenom());
|
stmt.setString(3, p.getPrenom());
|
||||||
stmt.setInt(4, p.getStatut());
|
stmt.setInt(4, p.getStatut());
|
||||||
stmt.setString(5,p.getMail() );
|
stmt.setString(5, p.getMail());
|
||||||
stmt.setString(6,p.getLogin() );
|
stmt.setString(6, p.getLogin());
|
||||||
stmt.setString(7,p.getMdp() );
|
stmt.setString(7, p.getMdp());
|
||||||
stmt.setInt(8, p.getAdrNo());
|
stmt.setInt(8, p.getAdrNo());
|
||||||
stmt.setString(9, p.getAdrRue());
|
stmt.setString(9, p.getAdrRue());
|
||||||
stmt.setString(10, p.getAdrCP());
|
stmt.setString(10, p.getAdrCP());
|
||||||
@ -104,7 +151,6 @@ public class PompierMySql {
|
|||||||
System.out.println("Requête : " + stmt.toString());
|
System.out.println("Requête : " + stmt.toString());
|
||||||
int status = stmt.executeUpdate();
|
int status = stmt.executeUpdate();
|
||||||
|
|
||||||
|
|
||||||
// Recherche de l'identifiant du client créé
|
// Recherche de l'identifiant du client créé
|
||||||
if (status > 0) {
|
if (status > 0) {
|
||||||
ResultSet result = stmt.getGeneratedKeys();
|
ResultSet result = stmt.getGeneratedKeys();
|
||||||
@ -120,5 +166,33 @@ public class PompierMySql {
|
|||||||
return id;
|
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 adrCP;
|
||||||
private String adrVille;
|
private String adrVille;
|
||||||
private int grade;
|
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) {
|
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);
|
this(idCaserne, nom, prenom, statut, mail, login, mdp, adrNo, adrRue, adrCP, adrVille, grade, commentaire);
|
||||||
this.id = id;
|
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.idCaserne = idCaserne;
|
||||||
this.nom = nom;
|
this.nom = nom;
|
||||||
this.prenom = prenom;
|
this.prenom = prenom;
|
||||||
@ -44,9 +45,9 @@ public class Pompier {
|
|||||||
this.adrCP = adrCP;
|
this.adrCP = adrCP;
|
||||||
this.adrVille = adrVille;
|
this.adrVille = adrVille;
|
||||||
this.grade = grade;
|
this.grade = grade;
|
||||||
|
this.commentaire = commentaire;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@ -151,9 +152,17 @@ public class Pompier {
|
|||||||
this.grade = grade;
|
this.grade = grade;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getCommentaire() {
|
||||||
|
return commentaire;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCommentaire(String commentaire) {
|
||||||
|
this.commentaire = commentaire;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
int hash = 7;
|
int hash = 3;
|
||||||
hash = 29 * hash + this.id;
|
hash = 29 * hash + this.id;
|
||||||
hash = 29 * hash + this.idCaserne;
|
hash = 29 * hash + this.idCaserne;
|
||||||
hash = 29 * hash + Objects.hashCode(this.nom);
|
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.adrCP);
|
||||||
hash = 29 * hash + Objects.hashCode(this.adrVille);
|
hash = 29 * hash + Objects.hashCode(this.adrVille);
|
||||||
hash = 29 * hash + this.grade;
|
hash = 29 * hash + this.grade;
|
||||||
|
hash = 29 * hash + Objects.hashCode(this.commentaire);
|
||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -221,13 +231,17 @@ public class Pompier {
|
|||||||
if (!Objects.equals(this.adrVille, other.adrVille)) {
|
if (!Objects.equals(this.adrVille, other.adrVille)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (!Objects.equals(this.commentaire, other.commentaire)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
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;
|
package com.test.forms;
|
||||||
|
|
||||||
|
import bdd.PompierMySql;
|
||||||
import com.test.beans.Pompier;
|
import com.test.beans.Pompier;
|
||||||
import com.test.beans.UserP;
|
import com.test.beans.UserP;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
@ -40,12 +41,18 @@ public class AuthentifForm {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
public boolean controlerRole(HttpServletRequest request) {
|
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;
|
if (erreur > 0) return -1;
|
||||||
|
|
||||||
// Creation d'un objet de type Client avec les données transmises
|
// 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("idCaserne"),
|
||||||
request.getParameter("ztNom"),
|
request.getParameter("ztNom"),
|
||||||
request.getParameter("ztPrenom"),
|
request.getParameter("ztPrenom"),
|
||||||
@ -59,7 +59,8 @@ public class NouveauPompForm {
|
|||||||
request.getParameter("ztAdrRue"),
|
request.getParameter("ztAdrRue"),
|
||||||
request.getParameter("ztAdrCP"),
|
request.getParameter("ztAdrCP"),
|
||||||
request.getParameter("ztAdrVille"),
|
request.getParameter("ztAdrVille"),
|
||||||
request.getParameter("nGrade")
|
request.getParameter("nGrade"),
|
||||||
|
request.getParameter("commentaire")
|
||||||
);
|
);
|
||||||
PompierMySql cm = new PompierMySql();
|
PompierMySql cm = new PompierMySql();
|
||||||
int id = cm.createRP(unPompier); // Requête préparée
|
int id = cm.createRP(unPompier); // Requête préparée
|
||||||
|
@ -57,6 +57,8 @@ public class ModifPompierServlet extends HttpServlet {
|
|||||||
@Override
|
@Override
|
||||||
protected void doGet(HttpServletRequest request, HttpServletResponse response)
|
protected void doGet(HttpServletRequest request, HttpServletResponse response)
|
||||||
throws ServletException, IOException {
|
throws ServletException, IOException {
|
||||||
|
PompierMysql PompierMs = new PompierMySql();
|
||||||
|
request.setAttribute("unPompier", PomperMs.readAll());
|
||||||
processRequest(request, response);
|
processRequest(request, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,18 +78,18 @@ public class authentifServlet extends HttpServlet {
|
|||||||
// Création de l'objet leControle de type AuthentifForm
|
// Création de l'objet leControle de type AuthentifForm
|
||||||
AuthentifForm leControle = new AuthentifForm();
|
AuthentifForm leControle = new AuthentifForm();
|
||||||
// Appel de la méthode controlerRole
|
// 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)
|
// Création de 2 attributs de requête (isChef et leControle)
|
||||||
request.setAttribute("isChef", isChef);
|
request.setAttribute("isAuthentified", isAuthentified);
|
||||||
request.setAttribute("controlForm", leControle);
|
request.setAttribute("controlForm", leControle);
|
||||||
HttpSession maSession = request.getSession();
|
HttpSession maSession = request.getSession();
|
||||||
maSession.setAttribute("isAuthentified", true);
|
maSession.setAttribute("isAuthentified", true);
|
||||||
// Affichage de la JSP
|
// Affichage de la JSP
|
||||||
if(isChef==true){
|
if(isAuthentified==true){
|
||||||
getServletContext().getRequestDispatcher("/WEB-INF/ChefCaserneJSP.jsp")
|
getServletContext().getRequestDispatcher("/WEB-INF/PompierJSP.jsp")
|
||||||
.forward(request, response);
|
.forward(request, response);
|
||||||
}else{
|
}else{
|
||||||
getServletContext().getRequestDispatcher("/WEB-INF/PompierJSP.jsp")
|
getServletContext().getRequestDispatcher("/WEB-INF/accueilJSP.jsp")
|
||||||
.forward(request, response);
|
.forward(request, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
--%>
|
--%>
|
||||||
<%@include file = "jspf/enteteJSPF.jspf" %>
|
<%@include file = "jspf/enteteJSPF.jspf" %>
|
||||||
<%@page contentType="text/html" pageEncoding="UTF-8"%>
|
<%@page contentType="text/html" pageEncoding="UTF-8"%>
|
||||||
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
@ -48,7 +49,7 @@
|
|||||||
<td><c:out value="${unPompier.getAdrCP()}"/></td>
|
<td><c:out value="${unPompier.getAdrCP()}"/></td>
|
||||||
<td><c:out value="${unPompier.getAdrVille()}"/></td>
|
<td><c:out value="${unPompier.getAdrVille()}"/></td>
|
||||||
<td><c:out value="${unPompier.getGrade()}"/></td>
|
<td><c:out value="${unPompier.getGrade()}"/></td>
|
||||||
<td><c:out value="${unPompier.getCom()}"/></td>
|
<td><c:out value="${unPompier.getCommentaire()}"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
--%>
|
--%>
|
||||||
<%@include file = "jspf/enteteJSPF.jspf" %>
|
<%@include file = "jspf/enteteJSPF.jspf" %>
|
||||||
<%@page contentType="text/html" pageEncoding="UTF-8"%>
|
<%@page contentType="text/html" pageEncoding="UTF-8"%>
|
||||||
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
@ -17,44 +18,42 @@
|
|||||||
<legend>Fiche Pompier</legend>
|
<legend>Fiche Pompier</legend>
|
||||||
<form name="fPompier" method="POST" action="ModifPompier">
|
<form name="fPompier" method="POST" action="ModifPompier">
|
||||||
<label for="nIdCaserne">Id Caserne : </label>
|
<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>
|
<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>
|
<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>
|
<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>
|
<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>
|
<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>
|
<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>
|
<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>
|
<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>
|
<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>
|
<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>
|
<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" />
|
<input type="submit" value="Valider" />
|
||||||
</form>
|
</form>
|
||||||
</fieldset>
|
</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>
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -8,12 +8,7 @@
|
|||||||
<%@page import="com.test.forms.AuthentifForm" %>
|
<%@page import="com.test.forms.AuthentifForm" %>
|
||||||
<%@page contentType="text/html" pageEncoding="UTF-8"%>
|
<%@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>
|
<fieldset>
|
||||||
<legend>Authentification</legend>
|
<legend>Authentification</legend>
|
||||||
<form method="POST" action="Authentification">
|
<form method="POST" action="Authentification">
|
||||||
@ -22,13 +17,11 @@ ${empty param.ztPseudo ? "Veuillez vous authentifier" : "Authentification réuss
|
|||||||
<input type="submit" value="Valider" />
|
<input type="submit" value="Valider" />
|
||||||
</form>
|
</form>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</c:when>
|
|
||||||
<c:otherwise>
|
|
||||||
<!-- Si l'utilisateur s'est authentifié,
|
<!-- Si l'utilisateur s'est authentifié,
|
||||||
Affichage du message contenu dans l'objet controlForm de type AuthentifForm -->
|
Affichage du message contenu dans l'objet controlForm de type AuthentifForm -->
|
||||||
|
|
||||||
<p>${controlForm.getResultat()}</p>
|
<p>${controlForm.getResultat()}</p>
|
||||||
</c:otherwise>
|
|
||||||
</c:choose>
|
|
||||||
|
|
||||||
<br />
|
<br />
|
Loading…
x
Reference in New Issue
Block a user