update jakarta
This commit is contained in:
@@ -82,4 +82,25 @@ public class ClientMysql {
|
|||||||
}
|
}
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean update(int id, String nom, String prenom, String mail) {
|
||||||
|
String sql = "UPDATE client SET nom=?, prenom=?, mail=? WHERE id=?";
|
||||||
|
int update = 0;
|
||||||
|
try {
|
||||||
|
PreparedStatement preparedStmt = laConnexion.prepareStatement(sql);
|
||||||
|
|
||||||
|
preparedStmt.setString(1, nom);
|
||||||
|
preparedStmt.setString(2, prenom);
|
||||||
|
preparedStmt.setString(3, mail);
|
||||||
|
preparedStmt.setInt(4, id);
|
||||||
|
|
||||||
|
update = preparedStmt.executeUpdate();
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
System.out.println("SQLException:"+ex.getMessage());
|
||||||
|
System.out.println("SQLState:"+ex.getSQLState());
|
||||||
|
System.out.println("code Erreur:"+ex.getErrorCode());
|
||||||
|
}
|
||||||
|
|
||||||
|
return update > 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
44
src/main/java/com/test/forms/ModifClientForm.java
Normal file
44
src/main/java/com/test/forms/ModifClientForm.java
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
/*
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
|
||||||
|
*/
|
||||||
|
package com.test.forms;
|
||||||
|
|
||||||
|
import com.test.bdd.ClientMysql;
|
||||||
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author steve.maingana
|
||||||
|
*/
|
||||||
|
public class ModifClientForm {
|
||||||
|
public String resultat;
|
||||||
|
|
||||||
|
public ModifClientForm() {};
|
||||||
|
|
||||||
|
public String getResultat() {
|
||||||
|
return resultat;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setResultat(String resultat) {
|
||||||
|
this.resultat = resultat;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean modifierClient(HttpServletRequest request) {
|
||||||
|
ClientMysql clientDB = new ClientMysql();
|
||||||
|
String id = request.getParameter("clientId");
|
||||||
|
String nom = request.getParameter("clientNom");
|
||||||
|
String prenom = request.getParameter("clientPrenom");
|
||||||
|
String mail = request.getParameter("clientMail");
|
||||||
|
|
||||||
|
boolean modification = clientDB.update(Integer.parseInt(id), nom, prenom, mail);
|
||||||
|
|
||||||
|
if (modification) {
|
||||||
|
this.setResultat("Le client N°"+id+" a été modifié avec succès");
|
||||||
|
} else {
|
||||||
|
this.setResultat("Je n'ai pas pu modifier le client N°"+id);
|
||||||
|
}
|
||||||
|
|
||||||
|
return modification;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -88,7 +88,7 @@ public class AuthentifServlet extends HttpServlet {
|
|||||||
if (!pseudo.isBlank() && !mdp.isBlank()) {
|
if (!pseudo.isBlank() && !mdp.isBlank()) {
|
||||||
if (authentification.existeUser(request)) {
|
if (authentification.existeUser(request)) {
|
||||||
boolean isAdmin = authentification.controlerAdmin(request);
|
boolean isAdmin = authentification.controlerAdmin(request);
|
||||||
request.setAttribute("admin", isAdmin);
|
maSession.setAttribute("isAdmin", isAdmin);
|
||||||
maSession.setAttribute("isAuthentified", true);
|
maSession.setAttribute("isAuthentified", true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
97
src/main/java/com/test/servlets/DeconnexionServlet.java
Normal file
97
src/main/java/com/test/servlets/DeconnexionServlet.java
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
/*
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/JSP_Servlet/Servlet.java to edit this template
|
||||||
|
*/
|
||||||
|
package com.test.servlets;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.PrintWriter;
|
||||||
|
import jakarta.servlet.ServletException;
|
||||||
|
import jakarta.servlet.annotation.WebServlet;
|
||||||
|
import jakarta.servlet.http.HttpServlet;
|
||||||
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import jakarta.servlet.http.HttpSession;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author steve.maingana
|
||||||
|
*/
|
||||||
|
|
||||||
|
@WebServlet(name = "DeconnexionServlet", urlPatterns = {"/deconnexion"})
|
||||||
|
|
||||||
|
public class DeconnexionServlet extends HttpServlet {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Processes requests for both HTTP <code>GET</code> and <code>POST</code>
|
||||||
|
* methods.
|
||||||
|
*
|
||||||
|
* @param request servlet request
|
||||||
|
* @param response servlet response
|
||||||
|
* @throws ServletException if a servlet-specific error occurs
|
||||||
|
* @throws IOException if an I/O error occurs
|
||||||
|
*/
|
||||||
|
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. */
|
||||||
|
out.println("<!DOCTYPE html>");
|
||||||
|
out.println("<html>");
|
||||||
|
out.println("<head>");
|
||||||
|
out.println("<title>Servlet DeconnexionServlet</title>");
|
||||||
|
out.println("</head>");
|
||||||
|
out.println("<body>");
|
||||||
|
out.println("<h1>Servlet DeconnexionServlet at " + request.getContextPath() + "</h1>");
|
||||||
|
out.println("</body>");
|
||||||
|
out.println("</html>");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
|
||||||
|
/**
|
||||||
|
* Handles the HTTP <code>GET</code> method.
|
||||||
|
*
|
||||||
|
* @param request servlet request
|
||||||
|
* @param response servlet response
|
||||||
|
* @throws ServletException if a servlet-specific error occurs
|
||||||
|
* @throws IOException if an I/O error occurs
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void doGet(HttpServletRequest request, HttpServletResponse response)
|
||||||
|
throws ServletException, IOException {
|
||||||
|
HttpSession maSession = request.getSession();
|
||||||
|
boolean isAuthentified = (maSession.getAttribute("isAuthentified") != null) ? (boolean) maSession.getAttribute("isAuthentified") : false;
|
||||||
|
if (isAuthentified) {
|
||||||
|
maSession.removeAttribute("isAuthentified");
|
||||||
|
maSession.removeAttribute("isAdmin");
|
||||||
|
}
|
||||||
|
|
||||||
|
response.sendRedirect("/Test2Jakarta/Accueil");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handles the HTTP <code>POST</code> method.
|
||||||
|
*
|
||||||
|
* @param request servlet request
|
||||||
|
* @param response servlet response
|
||||||
|
* @throws ServletException if a servlet-specific error occurs
|
||||||
|
* @throws IOException if an I/O error occurs
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void doPost(HttpServletRequest request, HttpServletResponse response)
|
||||||
|
throws ServletException, IOException {
|
||||||
|
processRequest(request, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a short description of the servlet.
|
||||||
|
*
|
||||||
|
* @return a String containing servlet description
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String getServletInfo() {
|
||||||
|
return "Short description";
|
||||||
|
}// </editor-fold>
|
||||||
|
|
||||||
|
}
|
||||||
102
src/main/java/com/test/servlets/ModifClientServlet.java
Normal file
102
src/main/java/com/test/servlets/ModifClientServlet.java
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
/*
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/JSP_Servlet/Servlet.java to edit this template
|
||||||
|
*/
|
||||||
|
package com.test.servlets;
|
||||||
|
|
||||||
|
import com.test.forms.ModifClientForm;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.PrintWriter;
|
||||||
|
import jakarta.servlet.ServletException;
|
||||||
|
import jakarta.servlet.annotation.WebServlet;
|
||||||
|
import jakarta.servlet.http.HttpServlet;
|
||||||
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import jakarta.servlet.http.HttpSession;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author steve.maingana
|
||||||
|
*/
|
||||||
|
@WebServlet(name = "ModifClientServlet", urlPatterns = {"modifierClient"})
|
||||||
|
public class ModifClientServlet extends HttpServlet {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Processes requests for both HTTP <code>GET</code> and <code>POST</code>
|
||||||
|
* methods.
|
||||||
|
*
|
||||||
|
* @param request servlet request
|
||||||
|
* @param response servlet response
|
||||||
|
* @throws ServletException if a servlet-specific error occurs
|
||||||
|
* @throws IOException if an I/O error occurs
|
||||||
|
*/
|
||||||
|
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. */
|
||||||
|
out.println("<!DOCTYPE html>");
|
||||||
|
out.println("<html>");
|
||||||
|
out.println("<head>");
|
||||||
|
out.println("<title>Servlet ModifClientServlet</title>");
|
||||||
|
out.println("</head>");
|
||||||
|
out.println("<body>");
|
||||||
|
out.println("<h1>Servlet ModifClientServlet at " + request.getContextPath() + "</h1>");
|
||||||
|
out.println("</body>");
|
||||||
|
out.println("</html>");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
|
||||||
|
/**
|
||||||
|
* Handles the HTTP <code>GET</code> method.
|
||||||
|
*
|
||||||
|
* @param request servlet request
|
||||||
|
* @param response servlet response
|
||||||
|
* @throws ServletException if a servlet-specific error occurs
|
||||||
|
* @throws IOException if an I/O error occurs
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void doGet(HttpServletRequest request, HttpServletResponse response)
|
||||||
|
throws ServletException, IOException {
|
||||||
|
processRequest(request, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handles the HTTP <code>POST</code> method.
|
||||||
|
*
|
||||||
|
* @param request servlet request
|
||||||
|
* @param response servlet response
|
||||||
|
* @throws ServletException if a servlet-specific error occurs
|
||||||
|
* @throws IOException if an I/O error occurs
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void doPost(HttpServletRequest request, HttpServletResponse response)
|
||||||
|
throws ServletException, IOException {
|
||||||
|
HttpSession maSession = request.getSession();
|
||||||
|
boolean isAuthentified = (maSession.getAttribute("isAuthentified") != null) ? (boolean) maSession.getAttribute("isAuthentified") : false;
|
||||||
|
boolean isAdmin = (maSession.getAttribute("isAdmin") != null) ? (boolean) maSession.getAttribute("isAdmin") : false;
|
||||||
|
if (!isAuthentified || !isAdmin) {
|
||||||
|
response.sendRedirect("/Test2Jakarta/Accueil");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ModifClientForm modification = new ModifClientForm();
|
||||||
|
boolean modifClient = modification.modifierClient(request);
|
||||||
|
request.setAttribute("modification", modifClient);
|
||||||
|
request.setAttribute("modification_message", modification.getResultat());
|
||||||
|
|
||||||
|
response.sendRedirect("/Test2Jakarta/ListeClients");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a short description of the servlet.
|
||||||
|
*
|
||||||
|
* @return a String containing servlet description
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String getServletInfo() {
|
||||||
|
return "Short description";
|
||||||
|
}// </editor-fold>
|
||||||
|
|
||||||
|
}
|
||||||
@@ -62,10 +62,10 @@ public class NouveauServlet extends HttpServlet {
|
|||||||
@Override
|
@Override
|
||||||
protected void doGet(HttpServletRequest request, HttpServletResponse response)
|
protected void doGet(HttpServletRequest request, HttpServletResponse response)
|
||||||
throws ServletException, IOException {
|
throws ServletException, IOException {
|
||||||
// processRequest(request, response);
|
|
||||||
HttpSession maSession = request.getSession();
|
HttpSession maSession = request.getSession();
|
||||||
boolean isAuthentified = (maSession.getAttribute("isAuthentified") != null) ? (boolean) maSession.getAttribute("isAuthentified") : false;
|
boolean isAuthentified = (maSession.getAttribute("isAuthentified") != null) ? (boolean) maSession.getAttribute("isAuthentified") : false;
|
||||||
if (!isAuthentified) {
|
boolean isAdmin = (maSession.getAttribute("isAdmin") != null) ? (boolean) maSession.getAttribute("isAdmin") : false;
|
||||||
|
if (!isAuthentified || !isAdmin) {
|
||||||
response.sendRedirect("/Test2Jakarta/Accueil");
|
response.sendRedirect("/Test2Jakarta/Accueil");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,8 +26,5 @@
|
|||||||
</c:choose>
|
</c:choose>
|
||||||
</c:when>
|
</c:when>
|
||||||
</c:choose>
|
</c:choose>
|
||||||
<p>
|
|
||||||
${sessionScope.isAuthentified}
|
|
||||||
</p>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<%-- any content can be specified here e.g.: --%>
|
<%-- any content can be specified here e.g.: --%>
|
||||||
<%@ page pageEncoding="UTF-8" %>
|
<%@ page pageEncoding="UTF-8" %>
|
||||||
<form method="POST" action="authentification">
|
<form class="nouveau-client" method="POST" action="authentification">
|
||||||
<label>Nom d'utilisateur: <input name="pseudo" type='text'></label><br>
|
<label>Nom d'utilisateur: <input name="pseudo" type='text'></label><br>
|
||||||
<label>Mot de passe: <input name='mdp' type='password'></label><br>
|
<label>Mot de passe: <input name='mdp' type='password'></label><br>
|
||||||
<button type="submit">Connexion</button>
|
<button type="submit">Connexion</button>
|
||||||
|
|||||||
@@ -1,9 +1,20 @@
|
|||||||
<%-- any content can be specified here e.g.: --%>
|
<%-- any content can be specified here e.g.: --%>
|
||||||
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||||
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||||
<%@ page pageEncoding="UTF-8" %>
|
<%@ page pageEncoding="UTF-8" %>
|
||||||
<nav>
|
<nav>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="/Test2Jakarta/Accueil">Accueil</a></li>
|
<li><a href="/Test2Jakarta/Accueil">Accueil</a></li>
|
||||||
<li><a href="/Test2Jakarta/ListeClients">Liste des clients</a></li>
|
<li><a href="/Test2Jakarta/ListeClients">Liste des clients</a></li>
|
||||||
<li><a href="/Test2Jakarta/NouveauClient">Nouveau client</a></li>
|
<c:choose>
|
||||||
|
<c:when test="${sessionScope.isAdmin}">
|
||||||
|
<li><a href="/Test2Jakarta/NouveauClient">Nouveau client</a></li>
|
||||||
|
</c:when>
|
||||||
|
</c:choose>
|
||||||
|
<c:choose>
|
||||||
|
<c:when test="${sessionScope.isAuthentified}">
|
||||||
|
<li><a href="/Test2Jakarta/deconnexion">Deconnexion</a></li>
|
||||||
|
</c:when>
|
||||||
|
</c:choose>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -12,10 +12,53 @@
|
|||||||
<body>
|
<body>
|
||||||
<%@include file="jspf/menu.jspf" %>
|
<%@include file="jspf/menu.jspf" %>
|
||||||
<h1>Liste des clients</h1>
|
<h1>Liste des clients</h1>
|
||||||
<ul>
|
<c:if test="${sessionScope.isAdmin}">
|
||||||
<c:forEach var="client" items="${clients}">
|
<c:choose>
|
||||||
<li>${client.getNom()}</li>
|
<c:when test="${modification == true}">
|
||||||
</c:forEach>
|
<p>${modification_message}</p>
|
||||||
</ul>
|
</c:when>
|
||||||
|
<c:when test="${!modification == false}">
|
||||||
|
<p>$modification_message</p>
|
||||||
|
</c:when>
|
||||||
|
</c:choose>
|
||||||
|
</c:if>
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<th>ID</th>
|
||||||
|
<th>Nom</th>
|
||||||
|
<th>Prénom</th>
|
||||||
|
<th>Adresse mail</th>
|
||||||
|
<c:choose>
|
||||||
|
<c:when test="${sessionScope.isAdmin}">
|
||||||
|
<th>Modification</th>
|
||||||
|
</c:when>
|
||||||
|
</c:choose>
|
||||||
|
</tr>
|
||||||
|
<c:forEach var="client" items="${clients}">
|
||||||
|
<c:choose>
|
||||||
|
<c:when test="${sessionScope.isAdmin}">
|
||||||
|
<tr>
|
||||||
|
<td>${client.getId()}</td>
|
||||||
|
<form method="post" action="modifierClient">
|
||||||
|
<input type="hidden" name="clientId" value="${client.getId()}">
|
||||||
|
<td><input type="text" name="clientNom" placeholder="${client.getNom()}"></td>
|
||||||
|
<td><input type="text" name="clientPrenom" placeholder="${client.getPrenom()}"></td>
|
||||||
|
<td><input type="text" name="clientMail" placeholder="${client.getMail()}"></td>
|
||||||
|
<td><button type="submit">Modifier</button></td>
|
||||||
|
</form>
|
||||||
|
</tr>
|
||||||
|
</c:when>
|
||||||
|
<c:when test="${!sessionScope.isAdmin}">
|
||||||
|
<tr>
|
||||||
|
<td>${client.getId()}</td>
|
||||||
|
<td>${client.getNom()}</td>
|
||||||
|
<td>${client.getPrenom()}</td>
|
||||||
|
<td>${client.getMail()}</td>
|
||||||
|
</tr>
|
||||||
|
</c:when>
|
||||||
|
</c:choose>
|
||||||
|
|
||||||
|
</c:forEach>
|
||||||
|
</table>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
<body>
|
<body>
|
||||||
<%@include file="jspf/menu.jspf" %>
|
<%@include file="jspf/menu.jspf" %>
|
||||||
<h1>Création d’un nouveau client</h1>
|
<h1>Création d’un nouveau client</h1>
|
||||||
<form method="post" action="NouveauClient">
|
<form class="nouveau-client" method="post" action="NouveauClient">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>Client :</legend>
|
<legend>Client :</legend>
|
||||||
<label>Nom :</label>
|
<label>Nom :</label>
|
||||||
|
|||||||
@@ -16,10 +16,14 @@
|
|||||||
<servlet-name>AuthentifServlet</servlet-name>
|
<servlet-name>AuthentifServlet</servlet-name>
|
||||||
<servlet-class>com.test.servlets.AuthentifServlet</servlet-class>
|
<servlet-class>com.test.servlets.AuthentifServlet</servlet-class>
|
||||||
</servlet>
|
</servlet>
|
||||||
<servlet-mapping>
|
<servlet>
|
||||||
<servlet-name>AccueilServlet</servlet-name>
|
<servlet-name>DeconnexionServlet</servlet-name>
|
||||||
<url-pattern>/Accueil</url-pattern>
|
<servlet-class>com.test.servlets.DeconnexionServlet</servlet-class>
|
||||||
</servlet-mapping>
|
</servlet>
|
||||||
|
<servlet>
|
||||||
|
<servlet-name>ModifClientServlet</servlet-name>
|
||||||
|
<servlet-class>com.test.servlets.ModifClientServlet</servlet-class>
|
||||||
|
</servlet>
|
||||||
<servlet-mapping>
|
<servlet-mapping>
|
||||||
<servlet-name>AccueilServlet</servlet-name>
|
<servlet-name>AccueilServlet</servlet-name>
|
||||||
<url-pattern>/Accueil</url-pattern>
|
<url-pattern>/Accueil</url-pattern>
|
||||||
@@ -36,9 +40,20 @@
|
|||||||
<servlet-name>AuthentifServlet</servlet-name>
|
<servlet-name>AuthentifServlet</servlet-name>
|
||||||
<url-pattern>/authentification</url-pattern>
|
<url-pattern>/authentification</url-pattern>
|
||||||
</servlet-mapping>
|
</servlet-mapping>
|
||||||
|
<servlet-mapping>
|
||||||
|
<servlet-name>DeconnexionServlet</servlet-name>
|
||||||
|
<url-pattern>/deconnexion</url-pattern>
|
||||||
|
</servlet-mapping>
|
||||||
|
<servlet-mapping>
|
||||||
|
<servlet-name>ModifClientServlet</servlet-name>
|
||||||
|
<url-pattern>/ModifClientServlet</url-pattern>
|
||||||
|
</servlet-mapping>
|
||||||
<session-config>
|
<session-config>
|
||||||
<session-timeout>
|
<session-timeout>
|
||||||
30
|
30
|
||||||
</session-timeout>
|
</session-timeout>
|
||||||
</session-config>
|
</session-config>
|
||||||
|
<welcome-file-list>
|
||||||
|
<welcome-file>Accueil</welcome-file>
|
||||||
|
</welcome-file-list>
|
||||||
</web-app>
|
</web-app>
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Start Page</title>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1><a href="/Test2Jakarta/Accueil">Accueil</a></h1>
|
|
||||||
<h1><a href="/Test2Jakarta/NouveauClient">Nouveau client</a></h1>
|
|
||||||
<h1><a href="/Test2Jakarta/ListeClients">Liste clients</a></h1>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -41,18 +41,62 @@ h1 {
|
|||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
form {
|
.nouveau-client {
|
||||||
text-align: center;
|
max-width: 500px;
|
||||||
margin: 8rem;
|
margin: 8rem auto;
|
||||||
padding: 2rem;
|
padding: 2rem;
|
||||||
background-color: var(--secondary-color);
|
background-color: var(--secondary-color);
|
||||||
border-radius: 8px;
|
border-radius: 10px;
|
||||||
border-style: none;
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
form label {
|
.nouveau-client label {
|
||||||
margin: auto;
|
display: block;
|
||||||
padding-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
|
color: #fff;
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nouveau-client input[type="submit"] {
|
||||||
|
display: block;
|
||||||
|
margin: 2rem auto 0 auto; /* espace au-dessus + centrage horizontal */
|
||||||
|
padding: 0.6rem 1.5rem;
|
||||||
|
border: none;
|
||||||
|
border-radius: 5px;
|
||||||
|
background-color: var(--primary-color, #3498db);
|
||||||
color: white;
|
color: white;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
font-size: 1rem;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background-color 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nouveau-client input[type="submit"]:hover {
|
||||||
|
background-color: var(--primary-color-hover, #2980b9);
|
||||||
|
}
|
||||||
|
|
||||||
|
table {
|
||||||
|
width: 80%;
|
||||||
|
margin: 0 auto;
|
||||||
|
border-collapse: collapse;
|
||||||
|
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
|
||||||
|
background-color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
th, td {
|
||||||
|
padding: 12px 15px;
|
||||||
|
text-align: left;
|
||||||
|
border-bottom: 1px solid #ddd;
|
||||||
|
}
|
||||||
|
|
||||||
|
th {
|
||||||
|
background-color: var(--primary-color);
|
||||||
|
color: white;
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
tr:hover {
|
||||||
|
background-color: #f1f1f1;
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user