Commit 95c67880 authored by Lefebvre michael's avatar Lefebvre michael

jsp tp5-6

parent da4c16ae
......@@ -8,7 +8,7 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<meta http-equiv="Content-Type" content="test/html; charset=ISO-8859-1"
<meta http-equiv="Content-Type" content="test/html; charset=ISO-8859-1">
<title>Login</title>
</head>
......
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="web" name="Web">
<configuration>
<descriptors>
<deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/web/WEB-INF/web.xml" />
</descriptors>
<webroots>
<root url="file://$MODULE_DIR$/web" relative="/" />
</webroots>
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" scope="PROVIDED" name="Tomcat 9.0.311" level="application_server_libraries" />
<orderEntry type="library" name="jstl-api-1.2" level="project" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<web-app 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_4_0.xsd"
version="4.0">
</web-app>
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: michael
Date: 19/02/2020
Time: 16:33
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<meta http-equiv="Refresh" content="0; URL=pages/login.jsp"/>
</head>
</html>
<%--
Created by IntelliJ IDEA.
User: michael
Date: 19/02/2020
Time: 16:37
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<meta http-equiv="Content-Type" content="test/html; charset=ISO-8859-1">
<title>Title</title>
</head>
<body>
<p>
Bonjour, ${requestScope.login.nom}
</p>
</body>
</html>
<%--
Created by IntelliJ IDEA.
User: michael
Date: 19/02/2020
Time: 16:36
To change this template use File | Settings | File Templates.
--%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<jsp:useBean id="login" class="metier.Login" scope="request">
<jsp:setProperty name="login" property="*"/>
</jsp:useBean>
<%--
if (login.isConnu()){
%>
<jsp:forward page="afficheView.jsp"/>
<%
}
--%>
<%--
<jsp:forward page="login.jsp"/>
--%>
<c:if test="${login.connu}">
<jsp:forward page="afficheView.jsp"/>
</c:if>
<jsp:forward page="login.jsp"/>
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: michael
Date: 19/02/2020
Time: 16:36
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<meta http-equiv="Content-Type" content="test/html; charset=ISO-8859-1">
<title>Title</title>
</head>
<body>
<div id="contenu">
<form method="POST" action="doCheckLogin.jsp">
<p class="double">
<label for="f1-nom">Nom : </label>
<input type="text" id="f1-nom" name="nom" value="${login.nom}">
</p>
<p class="double">
<label for="f1-pw">Password : </label>
<input type="text" id="f1-pw" name="password">
<span class="erreur">
${login.msgErreur}
</span>
</p>
<p>
<input type="submit" name="ok" value="Envoyer">
</p>
</form>
</div>
</body>
</html>
root {
display: block;
}
div#entete {
width: 500px;
padding: 10px 20px;
background: lavender;
color: midnightblue;
text-align:center;
font-weight: bold;
font-style: italic; font-size: 1.5em;
}
div#contenu{
width:500px;
padding: 10px 20px;
background: lavender;
color: midnightblue;
}
div#piedpage {
width:500px;
padding: 10px 20px;
background: lavender;
color: midnightblue;
}
form p {
margin: 1em 0;
}
form p.double {
/* Empcher le dpassement des flottants */
overflow: hidden;
width: 100%;
}
form p.double label {
float: left;
width: 150px;
text-align: right;
font-weight: bold;
cursor: pointer;
}
form p.double label span.info {
display: block;
margin-top: .2em;
font-size: .8em;
font-weight: normal;
cursor: default;
}
form p.double span.erreur {
margin-top: .2em;
font-weight: normal;
color: red;
}
form p.double input, form p.double textarea {
width: 250px;
margin-left: 12px;
border: solid 1px midnightblue;
padding: 2px 4px;
}
form p.double textarea {
padding: 2px 0 0 4px;
width: 320px;
height: 6em;
}
form p.double input[type="text"]:required {
background-color: bisque;
}
form p.simple {
margin-left: 160px;
}
form fieldset {
margin: 0; padding: 0; border: none;
}
form fieldset legend {
margin: 0; padding: 0; font-weight: bold; font-style: italic; font-size: 1.1em;
}
\ No newline at end of file
package metier;
public class Login {
private String nom = "";
private String password = "";
//GETTER SETTER
public String getNom() {
return nom;
}
public void setNom(String nom) {
this.nom = nom;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
//metier
public String getMsgErreur(){
return (this.isConnu() ? "" : "Inconnu");
}
public boolean isConnu(){
return (nom.equals("michael") && password.equals("tiger"));
}
//Constructeur
public Login() {
super();
}
}
<?xml version="1.0" encoding="UTF-8"?>
<web-app 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_4_0.xsd"
version="4.0">
</web-app>
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: michael
Date: 19/02/2020
Time: 16:33
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<meta http-equiv="Refresh" content="0; URL=pages/login.jsp"/>
</head>
</html>
<%--
Created by IntelliJ IDEA.
User: michael
Date: 19/02/2020
Time: 16:37
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<meta http-equiv="Content-Type" content="test/html; charset=ISO-8859-1">
<title>Title</title>
</head>
<body>
<p>
Bonjour, ${requestScope.login.nom}
</p>
</body>
</html>
<%--
Created by IntelliJ IDEA.
User: michael
Date: 19/02/2020
Time: 16:36
To change this template use File | Settings | File Templates.
--%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<jsp:useBean id="login" class="metier.Login" scope="request">
<jsp:setProperty name="login" property="*"/>
</jsp:useBean>
<%--
if (login.isConnu()){
%>
<jsp:forward page="afficheView.jsp"/>
<%
}
--%>
<%--
<jsp:forward page="login.jsp"/>
--%>
<c:if test="${login.connu}">
<jsp:forward page="afficheView.jsp"/>
</c:if>
<jsp:forward page="login.jsp"/>
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: michael
Date: 19/02/2020
Time: 16:36
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<meta http-equiv="Content-Type" content="test/html; charset=ISO-8859-1">
<title>Title</title>
</head>
<body>
<div id="contenu">
<form method="POST" action="doCheckLogin.jsp">
<p class="double">
<label for="f1-nom">Nom : </label>
<input type="text" id="f1-nom" name="nom" value="${login.nom}">
</p>
<p class="double">
<label for="f1-pw">Password : </label>
<input type="text" id="f1-pw" name="password">
<span class="erreur">
${login.msgErreur}
</span>
</p>
<p>
<input type="submit" name="ok" value="Envoyer">
</p>
</form>
</div>
</body>
</html>
root {
display: block;
}
div#entete {
width: 500px;
padding: 10px 20px;
background: lavender;
color: midnightblue;
text-align:center;
font-weight: bold;
font-style: italic; font-size: 1.5em;
}
div#contenu{
width:500px;
padding: 10px 20px;
background: lavender;
color: midnightblue;
}
div#piedpage {
width:500px;
padding: 10px 20px;
background: lavender;
color: midnightblue;
}
form p {
margin: 1em 0;
}
form p.double {
/* Empcher le dpassement des flottants */
overflow: hidden;
width: 100%;
}
form p.double label {
float: left;
width: 150px;
text-align: right;
font-weight: bold;
cursor: pointer;
}
form p.double label span.info {
display: block;
margin-top: .2em;
font-size: .8em;
font-weight: normal;
cursor: default;
}
form p.double span.erreur {
margin-top: .2em;
font-weight: normal;
color: red;
}
form p.double input, form p.double textarea {
width: 250px;
margin-left: 12px;
border: solid 1px midnightblue;
padding: 2px 4px;
}
form p.double textarea {
padding: 2px 0 0 4px;
width: 320px;
height: 6em;
}
form p.double input[type="text"]:required {
background-color: bisque;
}
form p.simple {
margin-left: 160px;
}
form fieldset {
margin: 0; padding: 0; border: none;
}
form fieldset legend {
margin: 0; padding: 0; font-weight: bold; font-style: italic; font-size: 1.1em;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment