Compare commits
26 Commits
d13cdc2f75
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
0d1d4385f9 | ||
|
30e988a406 | ||
|
ad2a770dc8 | ||
|
3cfc1f99e4 | ||
|
ff03911709 | ||
|
3eafc8b2ee | ||
|
0ec37013ed | ||
|
e27f948c2a | ||
|
1a26976d0a | ||
|
c7df279eab | ||
|
1e8257677c | ||
|
e5fa228860 | ||
|
05e4eb1b4c | ||
|
2d81cde4a8 | ||
|
94db0015ee | ||
|
fa6c0561f6 | ||
|
e58f60e5ec | ||
|
eb07fbaac9 | ||
|
caf65f4bfe | ||
|
cc1a3760ef | ||
|
5ebec6b026 | ||
|
239a3b33e7 | ||
|
8841819f19 | ||
|
1a8e93244b | ||
|
10c95e08ef | ||
|
18fb6ec354 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,2 +1,3 @@
|
||||
/nbproject/private/
|
||||
/build/
|
||||
/dist/
|
||||
|
BIN
proj/AP31-Projet1.war
Normal file
BIN
proj/AP31-Projet1.war
Normal file
Binary file not shown.
@@ -1,62 +1,67 @@
|
||||
package bdd;
|
||||
|
||||
/*
|
||||
Connexion.java
|
||||
Classe permettant d'établir une connexion avec une base de données mySQL
|
||||
*/
|
||||
*/
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
|
||||
public class Connexion {
|
||||
|
||||
private static Connection connect; // Variable de connexion
|
||||
|
||||
/**
|
||||
* Constructeur
|
||||
* @param serveur nom du serveur, localhost si local
|
||||
* @param bdd nom de la base de données
|
||||
* @param nomUtil nom utilisateur
|
||||
* @param mdp mot de passe lié à l'utilisateur
|
||||
*/
|
||||
private Connexion(String serveur, String bdd, String nomUtil, String mdp) {
|
||||
try {
|
||||
// 1. Chargement du driver
|
||||
//Class.forName("com.mysql.jdbc.Driver");
|
||||
Class.forName("com.mysql.cj.jdbc.Driver");
|
||||
System.out.println("Driver accessible");
|
||||
|
||||
// 2. Initialisation des paramètres de connexion
|
||||
String host = serveur; // Serveur de bd
|
||||
String dbname = bdd; // Nom bd
|
||||
String url = "jdbc:mysql://" + host + "/" + dbname; // url de connexion
|
||||
//url += "?autoReconnect=true"; // Ajout 26/09/2021
|
||||
System.out.println("url : "+url);
|
||||
String user = nomUtil; // nom du user
|
||||
System.out.println("nomUtil : "+nomUtil);
|
||||
String passwd = mdp; // mot de passe
|
||||
System.out.println("mdp : "+mdp);
|
||||
|
||||
// 3. Connexion
|
||||
connect = (Connection) DriverManager.getConnection(url, user, passwd);
|
||||
System.out.println("Connexion réussie !");
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne la connection établie (Création d'une connection si elle n'existe pas)
|
||||
* @param serveur nom du serveur, localhost si local
|
||||
* Constructeur
|
||||
*
|
||||
* @param serveur nom du serveur, localhost si local
|
||||
* @param bdd nom de la base de données
|
||||
* @param nomUtil nom utilisateur
|
||||
* @param mdp mot de passe lié à l'utilisateur
|
||||
*/
|
||||
private Connexion(String serveur, String bdd, String nomUtil, String mdp) {
|
||||
try {
|
||||
// 1. Chargement du driver
|
||||
//Class.forName("com.mysql.jdbc.Driver");
|
||||
Class.forName("com.mysql.cj.jdbc.Driver");
|
||||
System.out.println("Driver accessible");
|
||||
|
||||
// 2. Initialisation des paramètres de connexion
|
||||
String host = serveur; // Serveur de bd
|
||||
String dbname = bdd; // Nom bd
|
||||
String url = "jdbc:mysql://" + host + "/" + dbname; // url de connexion
|
||||
//url += "?autoReconnect=true"; // Ajout 26/09/2021
|
||||
System.out.println("url : " + url);
|
||||
String user = nomUtil; // nom du user
|
||||
System.out.println("nomUtil : " + nomUtil);
|
||||
String passwd = mdp; // mot de passe
|
||||
System.out.println("mdp : " + mdp);
|
||||
|
||||
// 3. Connexion
|
||||
connect = (Connection) DriverManager.getConnection(url, user, passwd);
|
||||
System.out.println("Connexion réussie !");
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne la connection établie (Création d'une connection si elle
|
||||
* n'existe pas)
|
||||
*
|
||||
* @param serveur nom du serveur, localhost si local
|
||||
* @param bdd nom de la base de données
|
||||
* @param nomUtil nom utilisateur
|
||||
* @param mdp mot de passe lié à l'utilisateur
|
||||
* @return connection établie
|
||||
*/
|
||||
*/
|
||||
public static Connection getConnect(String serveur, String bdd, String nomUtil, String mdp) {
|
||||
System.out.println("getConnect");
|
||||
if (connect == null) {
|
||||
new Connexion(serveur, bdd, nomUtil, mdp);
|
||||
}
|
||||
return connect;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -7,34 +7,38 @@ package bdd;
|
||||
|
||||
import com.mysql.cj.xdevapi.Client;
|
||||
import com.test.beans.Pompier;
|
||||
import com.test.forms.MD5;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import java.net.http.HttpRequest;
|
||||
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;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author thomas.millot
|
||||
*/
|
||||
public class PompierMysql {
|
||||
|
||||
|
||||
private Connection theConnection;
|
||||
private Pompier unPompier;
|
||||
|
||||
public PompierMysql()
|
||||
{
|
||||
|
||||
public PompierMysql() {
|
||||
theConnection = Connexion.getConnect("localhost", "sdis29", "admin", "minda");
|
||||
}
|
||||
|
||||
|
||||
public ArrayList<Pompier> readAll() {
|
||||
ArrayList<Pompier> lesPompiers = new ArrayList<>();
|
||||
|
||||
try {
|
||||
Statement stmt = theConnection.createStatement();
|
||||
ResultSet resultQ = null;
|
||||
resultQ = stmt.executeQuery("SELECT * FROM client");
|
||||
resultQ = stmt.executeQuery("SELECT * FROM pompier");
|
||||
while (resultQ.next()) {
|
||||
unPompier = new Pompier(resultQ.getInt("id"),
|
||||
resultQ.getString("nom"),
|
||||
@@ -63,65 +67,67 @@ public class PompierMysql {
|
||||
System.out.println("SQLState : " + ex.getSQLState());
|
||||
System.out.println("Code erreur : " + ex.getErrorCode());
|
||||
}
|
||||
|
||||
|
||||
return lesPompiers;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creation du client passé en paramètre dans la table client
|
||||
* Requête non préparée
|
||||
* Creation du client passé en paramètre dans la table client Requête non
|
||||
* préparée
|
||||
*
|
||||
* @param c objet de type Client (sans identifiant)
|
||||
* @return int : id du client créé
|
||||
*/
|
||||
public int create(Pompier p) {
|
||||
int id = -1;
|
||||
try {
|
||||
try {
|
||||
Statement stmt = theConnection.createStatement();
|
||||
int status = stmt.executeUpdate(
|
||||
"INSERT INTO pompier (nom, prenom, statut, mail, login, mdp, adresse, cp, ville, bip, nbGardes, grade, commentaire, dateEnreg, dateModif) "
|
||||
+ "VALUES ('" + p.getNom() + "', '"
|
||||
+ p.getPrenom() + "', '"
|
||||
+ p.getStatut() + "', "
|
||||
+ p.getMail() + ", '"
|
||||
+ p.getLogin() + "', '"
|
||||
+ p.getMdp() + "', '"
|
||||
+ p.getAdresse() + "', '"
|
||||
+ p.getVille()+ "', '"
|
||||
+ p.getBip()+ "', '"
|
||||
+ p.getNbGardes()+ "', '"
|
||||
+ p.getGrade()+ "', '"
|
||||
+ p.getCommentaire()+ "', '"
|
||||
+ p.getDateEnreg()+ "', '"
|
||||
+ p.getDateModif() + "');",
|
||||
Statement.RETURN_GENERATED_KEYS);
|
||||
|
||||
"INSERT INTO pompier (nom, prenom, statut, mail, login, mdp, adresse, cp, ville, bip, nbGardes, grade, commentaire, dateEnreg, dateModif) "
|
||||
+ "VALUES ('" + p.getNom() + "', '"
|
||||
+ p.getPrenom() + "', '"
|
||||
+ p.getStatut() + "', "
|
||||
+ p.getMail() + ", '"
|
||||
+ p.getLogin() + "', '"
|
||||
+ p.getMdp() + "', '"
|
||||
+ p.getAdresse() + "', '"
|
||||
+ p.getVille() + "', '"
|
||||
+ p.getBip() + "', '"
|
||||
+ p.getNbGardes() + "', '"
|
||||
+ p.getGrade() + "', '"
|
||||
+ p.getCommentaire() + "', '"
|
||||
+ p.getDateEnreg() + "', '"
|
||||
+ p.getDateModif() + "');",
|
||||
Statement.RETURN_GENERATED_KEYS);
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creation du client passé en paramètre dans la table client
|
||||
* Requête préparée
|
||||
* Creation du client passé en paramètre dans la table client Requête
|
||||
* préparée
|
||||
*
|
||||
* @param c objet de type Client (sans identifiant)
|
||||
* @return int : id du client créé
|
||||
*/
|
||||
public int createRP(Pompier p) {
|
||||
int id = -1;
|
||||
try {
|
||||
try {
|
||||
PreparedStatement stmt = null;
|
||||
String sql = "INSERT INTO pompier (nom, prenom, statut, mail, login, mdp, adresse, cp, ville, bip, nbGardes, grade, commentaire, dateEnreg, dateModif) "
|
||||
+ "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);";
|
||||
String sql = "INSERT INTO pompier (nom, prenom, statut, mail, login, mdp, adresse, cp, ville, bip, nbGardes, grade, commentaire, dateEnreg, dateModif) "
|
||||
+ "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);";
|
||||
stmt = theConnection.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);
|
||||
stmt.setString(1, p.getNom());
|
||||
stmt.setString(2, p.getPrenom());
|
||||
@@ -139,21 +145,42 @@ public class PompierMysql {
|
||||
stmt.setString(14, p.getDateModif());
|
||||
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 readPompier(HttpServletRequest request) {
|
||||
boolean reponse = false;
|
||||
Statement stmt;
|
||||
String userSaisi = request.getParameter("ztPseudo");
|
||||
String mdpSaisi = request.getParameter("ztMDP");
|
||||
String mdpChiffre = MD5.encode(mdpSaisi);
|
||||
System.out.println("userSaisi : "+ userSaisi);
|
||||
System.out.println("mdpSaisi : "+ mdpChiffre);
|
||||
try {
|
||||
System.out.println("Select * FROM pompier WHERE login = '"+userSaisi+"' AND mdp = '"+mdpChiffre+"';");
|
||||
stmt = theConnection.createStatement();
|
||||
ResultSet resultQ = null;
|
||||
resultQ = stmt.executeQuery("Select * FROM pompier WHERE login = '"+userSaisi+"' AND mdp = '"+mdpChiffre+"';");
|
||||
reponse = resultQ.next();
|
||||
} catch (SQLException ex) {
|
||||
Logger.getLogger(PompierMysql.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
|
||||
return reponse;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -12,6 +12,7 @@ import java.util.Objects;
|
||||
* @author thomas.millot
|
||||
*/
|
||||
public class Pompier {
|
||||
|
||||
private int id;
|
||||
private int idCaserne;
|
||||
private String nom;
|
||||
@@ -301,6 +302,5 @@ public class Pompier {
|
||||
public String toString() {
|
||||
return "Pompier{" + "id=" + id + ", idCaserne=" + idCaserne + ", nom=" + nom + ", prenom=" + prenom + ", Statut=" + Statut + ", typePers=" + typePers + ", mail=" + mail + ", login=" + login + ", mdp=" + mdp + ", adresse=" + adresse + ", cp=" + cp + ", ville=" + ville + ", bip=" + bip + ", nbGardes=" + nbGardes + ", grade=" + grade + ", commentaire=" + commentaire + ", dateEnreg=" + dateEnreg + ", dateModif=" + dateModif + '}';
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@@ -6,28 +6,30 @@
|
||||
package com.test.beans;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author thomas.millot
|
||||
*/
|
||||
public class User {
|
||||
|
||||
private String pseudo;
|
||||
private String mdp;
|
||||
|
||||
public User(String pseudo, String mdp){
|
||||
|
||||
public User(String pseudo, String mdp) {
|
||||
this.pseudo = pseudo;
|
||||
this.mdp = mdp;
|
||||
this.mdp = mdp;
|
||||
}
|
||||
|
||||
public String getPseudo(){
|
||||
|
||||
public String getPseudo() {
|
||||
return pseudo;
|
||||
}
|
||||
|
||||
public String getMdp(){
|
||||
|
||||
public String getMdp() {
|
||||
return mdp;
|
||||
}
|
||||
|
||||
public void setMdp(){
|
||||
|
||||
public void setMdp() {
|
||||
this.mdp = mdp;
|
||||
}
|
||||
|
||||
|
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
package com.test.forms;
|
||||
|
||||
import bdd.PompierMysql;
|
||||
import com.test.beans.User;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
@@ -13,7 +14,7 @@ import jakarta.servlet.http.HttpServletRequest;
|
||||
* @author thomas.millot
|
||||
*/
|
||||
public class AuthentifForm {
|
||||
|
||||
|
||||
private String resultat;
|
||||
|
||||
public String getResultat() {
|
||||
@@ -24,20 +25,13 @@ public class AuthentifForm {
|
||||
this.resultat = resultat;
|
||||
}
|
||||
|
||||
public boolean controlerAdmin(HttpServletRequest request){
|
||||
/* Comparaison entre l'utilisateur admin et un utilisateur créé
|
||||
avec le pseudo et le mdp saisi */
|
||||
User admin = new User("Lovelace", "Ada");
|
||||
User userSaisi = new User( request.getParameter("ztPseudo"),
|
||||
request.getParameter("ztMDP"));
|
||||
boolean isAdmin = userSaisi.equals(admin);
|
||||
|
||||
// Mise à jour de l'attribut resultat
|
||||
setResultat(isAdmin ? "Vous êtes administrateur" : "Vous n'êtes pas administrateur");
|
||||
|
||||
return isAdmin;
|
||||
|
||||
public boolean authentifPompier(HttpServletRequest request)
|
||||
{
|
||||
PompierMysql pms = new PompierMysql();
|
||||
boolean reponse = pms.readPompier(request);
|
||||
resultat = reponse ?"": "login ou mot de passe incorrect";
|
||||
request.setAttribute("message", resultat);
|
||||
return reponse;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -5,31 +5,32 @@
|
||||
*/
|
||||
package com.test.forms;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author sio
|
||||
*/
|
||||
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import javax.xml.bind.DatatypeConverter;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Dominique_2
|
||||
*/
|
||||
public abstract class MD5 {
|
||||
|
||||
public static String encode(String uneChaine){
|
||||
MessageDigest md = null;
|
||||
String myHash = null;
|
||||
MessageDigest md = null;
|
||||
try {
|
||||
md = MessageDigest.getInstance("MD5");
|
||||
} catch (NoSuchAlgorithmException ex) {
|
||||
Logger.getLogger(AuthentifForm.class.getName()).log(Level.SEVERE, null, ex);
|
||||
throw new IllegalArgumentException(ex);
|
||||
}
|
||||
md.update(uneChaine.getBytes());
|
||||
byte[] digest = md.digest();
|
||||
myHash = DatatypeConverter.printHexBinary(digest).toLowerCase();
|
||||
|
||||
return myHash;
|
||||
//myHash = DatatypeConverter.printHexBinary(digest).toLowerCase();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (byte b : digest) {
|
||||
sb.append(String.format("%02x", b));
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -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;
|
||||
@@ -35,7 +36,7 @@ public class AuthentifServlet extends HttpServlet {
|
||||
out.println("<!DOCTYPE html>");
|
||||
out.println("<html>");
|
||||
out.println("<head>");
|
||||
out.println("<title>Servlet AuthentifServlet</title>");
|
||||
out.println("<title>Servlet AuthentifServlet</title>");
|
||||
out.println("</head>");
|
||||
out.println("<body>");
|
||||
out.println("<h1>Servlet AuthentifServlet at " + request.getContextPath() + "</h1>");
|
||||
@@ -57,7 +58,7 @@ public class AuthentifServlet extends HttpServlet {
|
||||
protected void doGet(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException {
|
||||
//processRequest(request, response);
|
||||
getServletContext().getRequestDispatcher("/WEB-INF/AuthentificationJSP.jsp").forward(request, response);
|
||||
getServletContext().getRequestDispatcher("/WEB-INF/AuthentificationJSP.jsp").forward(request, response);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -71,7 +72,19 @@ 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 authentifPompier
|
||||
if(leControle.authentifPompier(request))
|
||||
{
|
||||
getServletContext().getRequestDispatcher("/WEB-INF/ProfilJSP.jsp")
|
||||
.forward(request, response);
|
||||
}
|
||||
else
|
||||
{
|
||||
getServletContext().getRequestDispatcher("/WEB-INF/AuthentificationJSP.jsp")
|
||||
.forward(request, response);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -35,7 +35,7 @@ public class ModifServlet extends HttpServlet {
|
||||
out.println("<!DOCTYPE html>");
|
||||
out.println("<html>");
|
||||
out.println("<head>");
|
||||
out.println("<title>Servlet ModifServlet</title>");
|
||||
out.println("<title>Servlet ModifServlet</title>");
|
||||
out.println("</head>");
|
||||
out.println("<body>");
|
||||
out.println("<h1>Servlet ModifServlet at " + request.getContextPath() + "</h1>");
|
||||
@@ -57,7 +57,7 @@ public class ModifServlet extends HttpServlet {
|
||||
protected void doGet(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException {
|
||||
//processRequest(request, response);
|
||||
getServletContext().getRequestDispatcher("/WEB-INF/ModifProfilJSP.jsp").forward(request, response);
|
||||
getServletContext().getRequestDispatcher("/WEB-INF/ModifProfilJSP.jsp").forward(request, response);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -84,4 +84,4 @@ public class ModifServlet extends HttpServlet {
|
||||
return "Short description";
|
||||
}// </editor-fold>
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -30,15 +30,15 @@ public class ProfilServlet extends HttpServlet {
|
||||
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. */
|
||||
try ( PrintWriter out = response.getWriter())
|
||||
{
|
||||
out.println("<!DOCTYPE html>");
|
||||
out.println("<html>");
|
||||
out.println("<head>");
|
||||
out.println("<title>Servlet ProfilServlet</title>");
|
||||
out.println("<title>Servlet ProfilServlets</title>");
|
||||
out.println("</head>");
|
||||
out.println("<body>");
|
||||
out.println("<h1>Servlet ProfilServlet at " + request.getContextPath() + "</h1>");
|
||||
out.println("<h1>Servlet ProfilServlets at " + request.getContextPath() + "</h1>");
|
||||
out.println("</body>");
|
||||
out.println("</html>");
|
||||
}
|
||||
@@ -57,7 +57,7 @@ public class ProfilServlet extends HttpServlet {
|
||||
protected void doGet(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException {
|
||||
//processRequest(request, response);
|
||||
getServletContext().getRequestDispatcher("/WEB-INF/ProfilJSP.jsp").forward(request, response);
|
||||
getServletContext().getRequestDispatcher("/WEB-INF/ProfilJSP.jsp").forward(request, response);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -71,7 +71,8 @@ public class ProfilServlet extends HttpServlet {
|
||||
@Override
|
||||
protected void doPost(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException {
|
||||
processRequest(request, response);
|
||||
getServletContext().getRequestDispatcher("/WEB-INF/ProfilJSP.jsp")
|
||||
.forward(request, response);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -84,4 +85,4 @@ public class ProfilServlet extends HttpServlet {
|
||||
return "Short description";
|
||||
}// </editor-fold>
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -1,26 +1,31 @@
|
||||
<%--
|
||||
Document : authentificationJSP
|
||||
Created on : 18 oct. 2021, 11:09:26
|
||||
Author : Chelloug.Eliass
|
||||
Author : Millot.Thomas
|
||||
--%>
|
||||
<%@include file="jspf/enteteJSPF.jspf" %>
|
||||
<div id="contenu">
|
||||
<h2>Merci de vous identifier pour acceder aux dossiers</h2>
|
||||
<form name="frmIdentification" method="POST" action="">
|
||||
<fieldset><legend>Identification utilisateur</legend>
|
||||
<br /><br />
|
||||
<label for="nom">Nom du compte</label>
|
||||
<input id="login" type="text" name="login" size="30" maxlength="45" placeholder="Entrez votre nom d'Utilisateur">
|
||||
</p>
|
||||
<p>
|
||||
<label for="mdp">Mot de passe</label>
|
||||
<input id="mdp" type="password" name="mdp" size="30" maxlength="45" placeholder="Entrez votre Mot de Passe">
|
||||
</p><br /><br />
|
||||
<input type="submit" name="valider" value="Valider">
|
||||
<input type="reset" name="annuler" value="Annuler">
|
||||
</p>
|
||||
</fieldset>
|
||||
</form>
|
||||
<br /><br/>
|
||||
</div>
|
||||
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@page import="com.test.forms.AuthentifForm" %>
|
||||
|
||||
<!-- Affichage du formulaire si l'utilisateur ne s'est pas encore authentifi<66> -->
|
||||
<div id="contenu">
|
||||
<form name="frmIdentification" method="POST" action="Authentif">
|
||||
<h2>Merci de vous identifier pour acceder aux dossiers</h2>
|
||||
<fieldset><legend>Identification utilisateur</legend>
|
||||
<br /><br />
|
||||
<label for="nom">Nom du compte</label>
|
||||
<input type="text" name="ztPseudo" size="30" maxlength="45" placeholder="Entrez votre nom d'Utilisateur">
|
||||
</p>
|
||||
<p>
|
||||
<label for="mdp">Mot de passe</label>
|
||||
<input type="password" name="ztMDP" size="30" maxlength="45" placeholder="Entrez votre Mot de Passe">
|
||||
</p><br /><br />
|
||||
<input type="submit" name="valider" value="Valider">
|
||||
<input type="reset" name="annuler" value="Annuler">
|
||||
</p>
|
||||
<p>${message}</p>
|
||||
</fieldset>
|
||||
</form>
|
||||
<br/><br/>
|
||||
</div>
|
||||
</html>
|
||||
|
@@ -1,17 +1,36 @@
|
||||
<%--
|
||||
Document : ModifProfilJSP
|
||||
Created on : 18 oct. 2021, 11:10:01
|
||||
Author : Chelloug.Eliass
|
||||
Author : Millot.thomas
|
||||
--%>
|
||||
|
||||
<%@include file="jspf/enteteJSPF.jspf" %>
|
||||
<%@page contentType="text/html" pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>JSP Page</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Hello World!</h1>
|
||||
</body>
|
||||
<form name="Profil" method="POST" action="ProfilJSP.jsp">
|
||||
<table style='border: 0px solid white;'>
|
||||
<tr>
|
||||
<td style='border :0px;'>
|
||||
<fieldset><legend>Coordonnées Pompier</legend>
|
||||
<table>
|
||||
<tr><th>Nom : </th><td><input type="text" name="ztNom" size="20" maxlength="30"></td></tr>
|
||||
<tr><th>Prénom : </th><td><input type="text" name="ztPrenom" size="20" maxlength="30"></td></tr>
|
||||
<tr><th>Adresse : </th><td><input type="text" name="ztAdr" size="20" maxlength="30"></td></tr>
|
||||
<tr><th>Ville : </th><td><input type="text"name="ztVille" size="20" maxlength="30"></td></tr>
|
||||
<tr><th>Code postal : </th><td><input type="text" name="ztCp" size="20" maxlength="30"></td></tr>
|
||||
<tr><th>Téléphone : </th><td><input type="text" name="ztTel" size="20" maxlength="30"></td></tr>
|
||||
<tr><th>Mail : </th><td><input type="text" name="ztMail" size="20" maxlength="30"></td></tr>
|
||||
<tr><th>Statut : </th><td><input readonly type="text" name="ztStatut" size="20" maxlength="30"></td></tr>
|
||||
<tr><th>Grade : </th><td><input readonly type="text" name="ztGrade" size="20" maxlength="30"></td></tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
<fieldset><legend>Coordonnées Employeur</legend>
|
||||
<table>
|
||||
<tr><th>Nom employeur : </th><td><input type="text" name="ztNomEmp" size="20" maxlength="30"></td></tr>
|
||||
<tr><th>Téléphone employeur : </th><td><input type="text" name="ztTelEmp" size="20" maxlength="30"></td></tr>
|
||||
<tr><th>Adresse employeur : </th><td><input type="text" name="ztadrEmp" size="20" maxlength="30"></td></tr>
|
||||
<tr><th>Mail employeur : </th><td><input type="text" name="ztMailEmp" size="20" maxlength="30"></td></tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
<input type="button" name="button" onclick="window.location='http://localhost:8080/AP31-Projet1/Profil'" value="Valider les modification">
|
||||
</html>
|
||||
|
@@ -1,25 +1,32 @@
|
||||
<%--
|
||||
Document : authentificationJSP
|
||||
Created on : 18 oct. 2021, 11:09:26
|
||||
Author : Chelloug.Eliass
|
||||
--%>
|
||||
<%@include file="jspf/enteteJSPF.jspf" %>
|
||||
<div id="contenu">
|
||||
<h2>Merci de vous identifier pour acceder aux dossiers</h2>
|
||||
<form name="frmIdentification" method="POST" action="Profil">
|
||||
<fieldset><legend>Identification utilisateur</legend>
|
||||
<br /><br />
|
||||
<label for="nom">Nom du compte</label>
|
||||
<input id="login" type="text" name="login" size="30" maxlength="45" placeholder="Entrez votre nom d'Utilisateur">
|
||||
</p>
|
||||
<p>
|
||||
<label for="mdp">Mot de passe</label>
|
||||
<input id="mdp" type="password" name="mdp" size="30" maxlength="45" placeholder="Entrez votre Mot de Passe">
|
||||
</p><br /><br />
|
||||
<input type="submit" name="valider" value="Valider">
|
||||
<input type="reset" name="annuler" value="Annuler">
|
||||
</p>
|
||||
</fieldset>
|
||||
</form>
|
||||
<br /><br />
|
||||
</div>
|
||||
<br /><br />
|
||||
<form name="frmModifProfil" method="POST" action="ModifProfilJSP.jsp">
|
||||
<table style='border: 0px solid white;'>
|
||||
<tr>
|
||||
<td style='border :0px;'>
|
||||
<fieldset><legend>Coordonn<6E>es Pompier</legend>
|
||||
<table>
|
||||
<tr><th>Nom : </th><td><input type="text" name="ztNom" size="20" maxlength="30"></td></tr>
|
||||
<tr><th>Pr<50>nom : </th><td><input type="text" name="ztPrenom" size="20" maxlength="30"></td></tr>
|
||||
<tr><th>Adresse : </th><td><input type="text" name="ztAdr" size="20" maxlength="30"></td></tr>
|
||||
<tr><th>Ville : </th><td><input type="text"name="ztVille" size="20" maxlength="30"></td></tr>
|
||||
<tr><th>Code postal : </th><td><input type="text" name="ztCp" size="20" maxlength="30"></td></tr>
|
||||
<tr><th>T<>l<EFBFBD>phone : </th><td><input type="text" name="ztTel" size="20" maxlength="30"></td></tr>
|
||||
<tr><th>Mail : </th><td><input type="text" name="ztMail" size="20" maxlength="30"></td></tr>
|
||||
<tr><th>Statut : </th><td><input readonly type="text" name="ztStatut" size="20" maxlength="30"></td></tr>
|
||||
<tr><th>Grade : </th><td><input readonly type="text" name="ztGrade" size="20" maxlength="30"></td></tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
<fieldset><legend>Coordonn<6E>es Employeur</legend>
|
||||
<table>
|
||||
<tr><th>Nom employeur : </th><td><input type="text" name="ztNomEmp" size="20" maxlength="30"></td></tr>
|
||||
<tr><th>T<>l<EFBFBD>phone employeur : </th><td><input type="text" name="ztTelEmp" size="20" maxlength="30"></td></tr>
|
||||
<tr><th>Adresse employeur : </th><td><input type="text" name="ztadrEmp" size="20" maxlength="30"></td></tr>
|
||||
<tr><th>Mail employeur : </th><td><input type="text" name="ztMailEmp" size="20" maxlength="30"></td></tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
<input type="button" name="button" onclick="window.location='http://localhost:8080/AP31-Projet1/Modif'" value="Modification du profil">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
@@ -1,10 +1,13 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
|
||||
<head>
|
||||
<<link rel="stylesheet" href="css/newcss.css"/>
|
||||
<title>SDIS29</title>
|
||||
</head>
|
||||
<div id="page">
|
||||
<div id="entete">
|
||||
<img src="./images/LogoSDIS29.jpg" id="logo" alt="SDIS29" title="SDIS 29" align='left' style="width: 200px; height: 180px" />
|
||||
<!-- fin de l'ent<6E>te -->
|
||||
<img src="./images/LogoSDIS29.jpg" id="logo" alt="SDIS29" title="SDIS 29" align='left' style="width: 200px; height: 180px";
|
||||
}/>
|
||||
<!-- fin de l'ent<6E>te -->
|
||||
|
59
web/css/newcss.css
Normal file
59
web/css/newcss.css
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
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.
|
||||
*/
|
||||
/*
|
||||
Created on : 21 oct. 2021, 16:37:16
|
||||
Author : elliass.chelloug
|
||||
*/
|
||||
body
|
||||
{
|
||||
background-color: #596b6e;
|
||||
background-repeat: repeat-x;
|
||||
margin:0% 0%;
|
||||
padding : 0.9em;
|
||||
font-family:"Trebuchet MS",Verdana,Geneva,Arial,Helvetica,sans-serif;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
#contenu
|
||||
{
|
||||
border: none;
|
||||
padding: 2.1em;
|
||||
background-color: white;
|
||||
border-left : groove 0.8em #980101;
|
||||
margin-top : 1.1em;
|
||||
margin-left: 82px;
|
||||
min-height:27em;
|
||||
height:27em;
|
||||
}
|
||||
piedForm
|
||||
{
|
||||
border-bottom-width : 0.1em;
|
||||
border-left-width : 0.1em;
|
||||
border-right-width : 0.1em;
|
||||
border-top-width : 0em;
|
||||
border-style : solid;
|
||||
border-color : #000;
|
||||
text-align:right ;
|
||||
width : 95%;
|
||||
margin-top:0em;
|
||||
}
|
||||
form
|
||||
{
|
||||
margin-bottom:1em;
|
||||
}
|
||||
corpsForm legend
|
||||
{
|
||||
font-weight:bold;
|
||||
font-size:1.2em;
|
||||
}
|
||||
corpsForm label
|
||||
{
|
||||
float: left;
|
||||
text-align:right;
|
||||
width:33%;
|
||||
margin: 0;
|
||||
padding: 0 .5em 0 0;
|
||||
line-height: 1.8;
|
||||
}
|
Reference in New Issue
Block a user