exo3: question 3 code.
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Tue, 10 Apr 2018 12:03:36 +0000 (14:03 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Tue, 10 Apr 2018 12:03:36 +0000 (14:03 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
ROOT/exo3/bool.jsp [new file with mode: 0644]

diff --git a/ROOT/exo3/bool.jsp b/ROOT/exo3/bool.jsp
new file mode 100644 (file)
index 0000000..6ce5ef6
--- /dev/null
@@ -0,0 +1,22 @@
+<%@ page import="java.io.*, java.util.*, javax.servlet.*" %>
+<html>
+<body>
+<%
+    String statuserparam = request.getParameter("statuser");
+    boolean statuser = false;
+    if (statuserparam.equals("true")) {
+        statuser = true;
+    } else if (statuserparam.equals("false")) {
+        statuser = false;
+    } else {
+        out.print("Empty or unknown statuser page parameter");
+    }
+    if (statuser) {
+        out.print("Bienvenue");
+    } else {
+        out.print("Au revoir");
+    }
+%>
+
+</body>
+</html>