From 55d3b02b183554f00271d824e208a9b09acd392a Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Wed, 11 Apr 2018 15:47:37 +0200 Subject: [PATCH] Add exo8 code. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- ROOT/exo7/form.jsp | 1 + ROOT/exo7/nextpage.jsp | 1 + ROOT/exo7/saveinfos.jsp | 2 +- ROOT/exo7/viewcookie.jsp | 2 +- ROOT/exo8/META-INF/context.xml | 2 + ROOT/exo8/WEB-INF/classes/user/UserData.class | Bin 0 -> 905 bytes ROOT/exo8/WEB-INF/src/user/UserData.java | 40 ++++++++++++++++++ ROOT/exo8/getname-form.html | 18 ++++++++ ROOT/exo8/saveinfos.jsp | 12 ++++++ 9 files changed, 76 insertions(+), 2 deletions(-) create mode 100644 ROOT/exo8/META-INF/context.xml create mode 100644 ROOT/exo8/WEB-INF/classes/user/UserData.class create mode 100644 ROOT/exo8/WEB-INF/src/user/UserData.java create mode 100644 ROOT/exo8/getname-form.html create mode 100644 ROOT/exo8/saveinfos.jsp diff --git a/ROOT/exo7/form.jsp b/ROOT/exo7/form.jsp index 96c73e6..87b0b52 100644 --- a/ROOT/exo7/form.jsp +++ b/ROOT/exo7/form.jsp @@ -1,3 +1,4 @@ + diff --git a/ROOT/exo7/nextpage.jsp b/ROOT/exo7/nextpage.jsp index f54b811..c1b1924 100644 --- a/ROOT/exo7/nextpage.jsp +++ b/ROOT/exo7/nextpage.jsp @@ -1,3 +1,4 @@ + Bonjour <% out.print(session.getAttribute("firstname")); %> diff --git a/ROOT/exo7/saveinfos.jsp b/ROOT/exo7/saveinfos.jsp index 11b0f65..37da3fd 100644 --- a/ROOT/exo7/saveinfos.jsp +++ b/ROOT/exo7/saveinfos.jsp @@ -10,7 +10,7 @@ session.setAttribute("address", address); session.setAttribute("age", age); session.setAttribute("work", work); %> - + Continue diff --git a/ROOT/exo7/viewcookie.jsp b/ROOT/exo7/viewcookie.jsp index 2a705f6..4335f35 100644 --- a/ROOT/exo7/viewcookie.jsp +++ b/ROOT/exo7/viewcookie.jsp @@ -1,5 +1,5 @@ <% Cookie[] cookies = request.getCookies(); %> - + Bonjour
diff --git a/ROOT/exo8/META-INF/context.xml b/ROOT/exo8/META-INF/context.xml new file mode 100644 index 0000000..00e2ff6 --- /dev/null +++ b/ROOT/exo8/META-INF/context.xml @@ -0,0 +1,2 @@ + diff --git a/ROOT/exo8/WEB-INF/classes/user/UserData.class b/ROOT/exo8/WEB-INF/classes/user/UserData.class new file mode 100644 index 0000000000000000000000000000000000000000..6fa20c26188d28c1bed71d556728df18332ce456 GIT binary patch literal 905 zcmZvZSxdt}6ot>EP21GerP{hLb*&2a#WzI|7Z8d*xV%qw43RcMn)CqT{;swf4KJnbH>$$-mq5ArjK=$DNhU`$& z_0(yv(^CG0Y_+*!cU5rQx31J<*?zqB`2k|h-vSDp9evl3<8WV>QH`IB>d;4R=a0i! zef_@$4M@cdIExH83=JxO4n__F#q;}~f31#PeVx)}SNVrBkXyQiHU=?dqX5fBQOkf9 z8zq80f{ln481A?HtaYcZ1Jw9DdA?qjKQmCFlZ26Z!pKyN7KApU4s$lkC>YI+SBNJL z1V*U2aM7TaF-q0wA`E`q+t_@8(PxX{ss)pV0%PfXCdrq`50bB>^VuXnLcUDCit)61 z%p_kSUnMz#$sfLd)n^!wiK}X8DizHnQJrTx70o8m8qt}s$GU;>0?Z`3LUfLhf%z}O Cy^Qn# literal 0 HcmV?d00001 diff --git a/ROOT/exo8/WEB-INF/src/user/UserData.java b/ROOT/exo8/WEB-INF/src/user/UserData.java new file mode 100644 index 0000000..f015477 --- /dev/null +++ b/ROOT/exo8/WEB-INF/src/user/UserData.java @@ -0,0 +1,40 @@ +package user; +public class UserData { + String firstname; + String lastname; + String email; + Integer age; + + public void setFirstname(String value) { + firstname = value; + } + + public void setLastname(String value) { + lastname = value; + } + + public void setEmail(String value) { + email = value; + } + + public void setAge(Integer value) { + age = value; + } + + public String getFirstname() { + return firstname; + } + + public String getLastname() { + return lastname; + } + + public String getEmail() { + return email; + } + + public Integer getAge() { + return age; + } + +} diff --git a/ROOT/exo8/getname-form.html b/ROOT/exo8/getname-form.html new file mode 100644 index 0000000..3b69fcc --- /dev/null +++ b/ROOT/exo8/getname-form.html @@ -0,0 +1,18 @@ + + + + +
+ First name:
+
+ Last name:
+
+ Email:
+
+ Age:
+

+ +
+ + + diff --git a/ROOT/exo8/saveinfos.jsp b/ROOT/exo8/saveinfos.jsp new file mode 100644 index 0000000..8ddc1a9 --- /dev/null +++ b/ROOT/exo8/saveinfos.jsp @@ -0,0 +1,12 @@ +<%@ page contentType="text/html" pageEncoding="UTF-8" %> + + + + + + Prénom: <%= user.getFirstname() %>
+ Nom: <%= user.getLastname() %>
+ Email: <%= user.getEmail() %>
+ Age: <%= user.getAge() %>
+ + -- 2.34.1