From: Jérôme Benoit Date: Tue, 10 Apr 2018 12:03:36 +0000 (+0200) Subject: exo3: question 3 code. X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=16de8c10f2fb956f27fd42c7ea62d0ad3f54d9de;p=TD_webapps.git exo3: question 3 code. Signed-off-by: Jérôme Benoit --- 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"); + } +%> + + +