This commit is contained in:
clement.bouillot
2021-10-18 11:00:32 +02:00
commit 1062bf48b2
30 changed files with 3229 additions and 0 deletions

2
web/META-INF/context.xml Normal file
View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Context path="/SDIS29"/>

View File

@@ -0,0 +1,79 @@
<%@include file = "jspf/enteteJSPF.jspf" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page import="com.test.forms.AuthentifForm" %>
<!-- Message de bienvenue personnalis<69> -->
<p>Bienvenue <c:out value="${param.ztPseudo}" /> sur la nouvelle application de gestion des clients</p>
${empty param.ztPseudo ? "Veuillez vous authentifier" : "Authentification r<>ussie"}
<!-- Affichage du formulaire si l'utilisateur ne s'est pas encore authentifi<66> -->
<c:choose>
<c:when test="${empty param.ztPseudo}">
<fieldset>
<legend>Authentification</legend>
<form method="POST" action="Accueil">
<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>
</c:when>
<c:otherwise>
<!-- Si l'utilisateur s'est authentifi<66>,
Affichage du message contenu dans l'objet controlForm de type AuthentifForm -->
<p>${controlForm.getResultat()}</p>
</c:otherwise>
</c:choose>
<br />
<!-- Affichage des 3 liens htpertexte -->
<%@include file="jspf/menuJSPF.jspf" %>
<!-- Test EL Expression Langage -->
<!-- Test avec formule de calcul -->
<h2>Tests divers </h2>F
${ 10 / 4} <br />
<p>Test avec EL et JSTL </p>
<p>ztPseudo : ${param.ztPseudo}</p>
<p>isAdmin : ${isAdmin}</p>
<p>Message re<72>u : ${controlForm.getResultat()}</p>
<c:out value="Test jstl : ${controlForm.getResultat()}" />
<c:out value="${controlForm.getResultat()}">
Je ne sais pas encore si vous <20>tes administrateur
</c:out>
<c:set var="message" value="Hello" scope="request" />
<p>Voici le message : ${message} </p>
<p> Test sur controlForm :
${empty controlForm.getResultat() ? "" : controlForm.getResultat()}
</p>
<c:out value="${empty param.ztPseudo ? 'none' : param.ztPseudo += ' enabled'}" />
<c:set var="langue" scope="request">
<c:out value="${param.lang}" default="fran<61>ais" />
</c:set>
<p>Langue : ${langue} </p>
<c:if test="${12 > 7}" var="resultatTest" scope="page" >
Test positif
</c:if>
<p> R<>sultat du test : ${resultatTest}</p>
<c:forEach var="i" begin="0" end="5" step="1" >
Instructions <20> r<>p<EFBFBD>ter (html, ou jstl)- ${i} <br />
</c:forEach>
Voici les controles : <br />
<c:forEach items="${lesControles}" var="unControle" >
${unControle.toString()} <br />
</c:forEach>
</body>
</html>

View File

@@ -0,0 +1,16 @@
<%-- any content can be specified here e.g.: --%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%--
Document : newjsp
Created on : 18 sept. 2021, 15:34:04
Author : Dominique_2
--%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Gestion des clients</title>
</head>
<body>
<h1>Gestion des clients</h1>

View File

@@ -0,0 +1,7 @@
<%-- any content can be specified here e.g.: --%>
<%@ page pageEncoding="UTF-8" %>
<nav>
<a href ="Accueil">Accueil</a>
<a href="NouveauClient">Création d'un nouveau client</a>
<a href="ListeClients">Liste des clients</a>
</nav>

48
web/WEB-INF/listeJSP.jsp Normal file
View File

@@ -0,0 +1,48 @@
<%@include file = "jspf/enteteJSPF.jspf" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page import="java.util.ArrayList" %>
<h2>Liste des clients</h2><!-- comment -->
<!-- <p>Page en cours de construction</p>
<img src="images/pageEnConstruction.jpg" alt="Page en construction"/>-->
<table border="1" cellspacing="3" cellpadding="1">
<thead>
<tr>
<th>No</th>
<th>Civilit<69></th>
<th>Nom</th>
<th>Pr<50>nom</th>
<th>Mot de passe</th>
<th>No</th>
<th>Rue</th>
<th>Ville</th>
<th>Code postal</th>
<th>Mail</th>
<th>T<>l</th>
<th>Date naissance</th>
</tr>
</thead>
<tbody>
<c:forEach items="${lesClients}" var="unClient">
<tr>
<td><c:out value="${unClient.getId()}"/></td>
<td><c:out value="${unClient.getCivilite()}"/></td>
<td><c:out value="${unClient.getNom()}"/></td>
<td><c:out value="${unClient.getPrenom()}"/></td>
<td><c:out value="${unClient.getMdp()}"/></td>
<td><c:out value="${unClient.getAdrNo()}"/></td>
<td><c:out value="${unClient.getAdrRue()}"/></td>
<td><c:out value="${unClient.getAdrVille()}"/></td>
<td><c:out value="${unClient.getAdrCP()}"/></td>
<td><c:out value="${unClient.getAdrmail()}"/></td>
<td><c:out value="${unClient.getTel()}"/></td>
<td><c:out value="${unClient.getDateNais()}"/></td>
</tr>
</c:forEach>
</tbody>
</table>
<br />
<%@include file="jspf/menuJSPF.jspf" %>
</body>
</html>

View File

@@ -0,0 +1,58 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@include file = "jspf/enteteJSPF.jspf" %>
<h2>Cr<43>ation d'un nouveau client</h2><!-- comment -->
<!-- <p>Page en cours de construction</p><!-- comment -->
<img src="images/pageEnConstruction.jpg" alt="Page en construction"/>
<fieldset>
<legend>Fiche client</legend>
<form name="fClient" action="NouveauClient" method="POST">
<label for="cbCivilite1">Mr </label>
<input type="radio" name="btrCivilite" id="btrCivilite1" value="Mr" checked />
<label for="cbCivilite2">Mme </label>
<input type="radio" name="btrCivilite" id="btrCivilite2" value="Mme" />
<label for="ztPrenom">Pr<50>nom </label>
<input type="text" name="ztPrenom" id="ztPrenom" value="" />
<label for="ztNom">Nom </label>
<input type="text" name="ztNom" id="ztNom" value="" />
<label for="ztPwd">Mot de passe </label>
<input type="password" name="ztPwd" id="ztPwd" value="" /><br>
Adresse postale :
<input type="text" name="ztNoRue" value="" placeholder="No"/>
<input type="text" name="ztRue" value="" placeholder="Rue"/>
<input type="text" name="ztCP" value="" placeholder="Code postal"/>
<input type="text" name="ztVille" value="" placeholder="Ville"/><br>
<label for="ztMail">Adresse mail </label>
<input type="email" name="ztMail" id="ztMail" value="" />
<label for="ztTel">T<>l<EFBFBD>phone </label>
<input type="text" name="ztTel" id="ztTel" value="" />
<label for="ztDateNais">Date de naissance </label>
<input type="date" min="1921-01-01" name="ztDateNais" id="ztDateNais" value="" />
<br>
<input type="submit" value="Valider" />
</form>
</fieldset>
<br>
<p>
<c:choose>
<c:when test="${idClient >= 0}">
Le client no ${idClient} a <20>t<EFBFBD> cr<63><72> avec succ<63>s
</c:when>
<c:when test="${idClient == -1}">
E R R E U R : ${message}
</c:when>
<c:otherwise>
Cliquez sur <em>"Valider"</em> apr<70>s avoir renseign<67> les informations demand<6E>es
</c:otherwise>
</c:choose>
</p>
<%@include file="jspf/menuJSPF.jspf" %>
<article>
<h3>Liste des num<75>ros des clients r<>cement cr<63><72>s : </h3>
<c:forEach items="${sessionScope.lesNvxClients}" var="unClient">
${unClient} -
</c:forEach>
</article>
</body>
</html>

35
web/WEB-INF/web.xml Normal file
View File

@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
<filter>
<filter-name>AuthentifFiltrer</filter-name>
<filter-class>com.test.filter.AuthentifFiltrer</filter-class>
</filter>
<filter-mapping>
<filter-name>AuthentifFiltrer</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>AccueilServlet</servlet-name>
<servlet-class>com.test.servlets.AccueilServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>NouveauServlet</servlet-name>
<servlet-class>com.test.servlets.NouveauServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>AuthentificationServlet</servlet-name>
<servlet-class>com.test.servlets.AuthentificationServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>AccueilServlet</servlet-name>
<url-pattern>/Accueil</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>NouveauServlet</servlet-name>
<url-pattern>/NouveauClient</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>AuthentificationServlet</servlet-name>
<url-pattern>/Authentification</url-pattern>
</servlet-mapping>
</web-app>

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

16
web/index.html Normal file
View File

@@ -0,0 +1,16 @@
<!DOCTYPE html>
<!--
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.
-->
<html>
<head>
<title>Gestion des clients</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div>TODO write content</div>
</body>
</html>

41
web/welcomeJSF.jsp Normal file
View File

@@ -0,0 +1,41 @@
<%--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%--
This file is an entry point for JavaServer Faces application.
--%>
<f:view>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>JSP Page</title>
</head>
<body>
<h1><h:outputText value="JavaServer Faces"/></h1>
</body>
</html>
</f:view>