From c69eb3b16833513b2109b19c2e3dfbb66550ef19 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Tue, 10 Apr 2018 16:41:06 +0200 Subject: [PATCH] exo7: fix to the form cinematic. 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 | 10 ++++++++-- ROOT/exo7/nextpage.jsp | 3 ++- ROOT/exo7/saveinfos.jsp | 18 ++++++++++++++++++ ROOT/exo7/savename.jsp | 11 ----------- 4 files changed, 28 insertions(+), 14 deletions(-) create mode 100644 ROOT/exo7/saveinfos.jsp delete mode 100644 ROOT/exo7/savename.jsp diff --git a/ROOT/exo7/form.jsp b/ROOT/exo7/form.jsp index 9b620a8..96c73e6 100644 --- a/ROOT/exo7/form.jsp +++ b/ROOT/exo7/form.jsp @@ -1,11 +1,17 @@ -
+ First name:

Last name:
-

+
+ Address:
+
+ Age:
+
+ Work:
+

diff --git a/ROOT/exo7/nextpage.jsp b/ROOT/exo7/nextpage.jsp index 8627414..37153a6 100644 --- a/ROOT/exo7/nextpage.jsp +++ b/ROOT/exo7/nextpage.jsp @@ -1,5 +1,6 @@ - Bonjour <%= session.getAttribute("theName") %> + Bonjour <% out.print(session.getAttribute("firstname")); %> <% out.print(session.getAttribute("lastname")); %>, <% out.print(session.getAttribute("age")); %> years old + living at <% out.print(session.getAttribute("address")); %> working as <% out.print(session.getAttribute("work")); %> diff --git a/ROOT/exo7/saveinfos.jsp b/ROOT/exo7/saveinfos.jsp new file mode 100644 index 0000000..11b0f65 --- /dev/null +++ b/ROOT/exo7/saveinfos.jsp @@ -0,0 +1,18 @@ +<% +String firstname = request.getParameter("firstname"); +String lastname = request.getParameter("lastname"); +String address = request.getParameter("address"); +String age = request.getParameter("age"); +String work = request.getParameter("work"); +session.setAttribute("firstname", firstname); +session.setAttribute("lastname", lastname); +session.setAttribute("address", address); +session.setAttribute("age", age); +session.setAttribute("work", work); +%> + + + + Continue + + diff --git a/ROOT/exo7/savename.jsp b/ROOT/exo7/savename.jsp deleted file mode 100644 index b790925..0000000 --- a/ROOT/exo7/savename.jsp +++ /dev/null @@ -1,11 +0,0 @@ -<% -String firstname = request.getParameter("firstname"); -String lastname = request.getParameter("lastname"); -session.setAttribute("theName", firstname + " " + lastname); -%> - - - - Continue - - -- 2.34.1