Add exo7 code.
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Tue, 10 Apr 2018 14:24:19 +0000 (16:24 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Tue, 10 Apr 2018 14:24:19 +0000 (16:24 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
ROOT/exo7/META-INF/context.xml [new file with mode: 0644]
ROOT/exo7/form.jsp [new file with mode: 0644]
ROOT/exo7/nextpage.jsp [new file with mode: 0644]
ROOT/exo7/savename.jsp [new file with mode: 0644]

diff --git a/ROOT/exo7/META-INF/context.xml b/ROOT/exo7/META-INF/context.xml
new file mode 100644 (file)
index 0000000..00e2ff6
--- /dev/null
@@ -0,0 +1,2 @@
+<Context path=""
+       antiResourceLocking="false" />
diff --git a/ROOT/exo7/form.jsp b/ROOT/exo7/form.jsp
new file mode 100644 (file)
index 0000000..9b620a8
--- /dev/null
@@ -0,0 +1,13 @@
+<html>
+<body>
+
+<form action="savename.jsp">
+  First name:<br>
+  <input type="text" name="firstname"><br>
+  Last name:<br>
+  <input type="text" name="lastname"><br><br>
+  <input type="submit" value="Submit">
+</form>
+
+</body>
+</html>
diff --git a/ROOT/exo7/nextpage.jsp b/ROOT/exo7/nextpage.jsp
new file mode 100644 (file)
index 0000000..8627414
--- /dev/null
@@ -0,0 +1,5 @@
+<html>
+    <body>
+        Bonjour <%= session.getAttribute("theName") %>
+    </body>
+</html>
diff --git a/ROOT/exo7/savename.jsp b/ROOT/exo7/savename.jsp
new file mode 100644 (file)
index 0000000..b790925
--- /dev/null
@@ -0,0 +1,11 @@
+<%
+String firstname = request.getParameter("firstname");
+String lastname = request.getParameter("lastname");
+session.setAttribute("theName", firstname + " " + lastname);
+%>
+
+<html>
+    <body>
+        <a href="nextpage.jsp">Continue</a>
+    </body>
+</html>