From 16de8c10f2fb956f27fd42c7ea62d0ad3f54d9de Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Tue, 10 Apr 2018 14:03:36 +0200 Subject: [PATCH] exo3: question 3 code. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- ROOT/exo3/bool.jsp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 ROOT/exo3/bool.jsp diff --git a/ROOT/exo3/bool.jsp b/ROOT/exo3/bool.jsp new file mode 100644 index 0000000..6ce5ef6 --- /dev/null +++ b/ROOT/exo3/bool.jsp @@ -0,0 +1,22 @@ +<%@ page import="java.io.*, java.util.*, javax.servlet.*" %> + + +<% + 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"); + } +%> + + + -- 2.34.1