From: Jérôme Benoit Date: Wed, 11 Apr 2018 13:47:37 +0000 (+0200) Subject: Add exo8 code. X-Git-Url: https://git.piment-noir.org/?p=TD_webapps.git;a=commitdiff_plain;h=55d3b02b183554f00271d824e208a9b09acd392a;ds=sidebyside Add exo8 code. Signed-off-by: Jérôme Benoit --- 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 0000000..6fa20c2 Binary files /dev/null and b/ROOT/exo8/WEB-INF/classes/user/UserData.class differ 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() %>
+ +