r7005: added a esp page to demonstrate exception handling
authorAndrew Tridgell <tridge@samba.org>
Fri, 27 May 2005 04:37:51 +0000 (04:37 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:17:05 +0000 (13:17 -0500)
swat/esptest/exception.esp [new file with mode: 0644]
swat/esptest/index.esp

diff --git a/swat/esptest/exception.esp b/swat/esptest/exception.esp
new file mode 100644 (file)
index 0000000..d569fbe
--- /dev/null
@@ -0,0 +1,37 @@
+<HTML>
+<TITLE>
+Samba4 ESP test
+</TITLE>
+<BODY>
+<h1>Samba4 exception test</h1>
+
+<form name="ExceptionTest" method="POST" action="@@request['SCRIPT_NAME']"> 
+    <input name="submit" type="submit" value="Generate Exception">
+    <input name="submit" type="submit" value="No Exception">
+    <input name="submit" type="submit" value="Cancel"><br>
+</form>
+
+<%
+if (request['REQUEST_METHOD'] == "POST") {
+       /* if they cancelled then take them back to the list of tests */
+       if (form['submit'] == "Cancel") {
+               redirect("index.esp");
+       }
+
+       function TestFunction(arg1, arg2) {
+                return "OK";
+       }
+
+       if (form['submit'] == "Generate Exception") {
+           write("I expect you to die Mr Bond!<br>\n");
+           TestFunction("foo");
+       } else {
+           write("no exception<br>\n");
+           TestFunction("foo", "bar");
+       }
+}
+%>
+
+and here is some filler text ...
+</BODY>
+</HTML>
index e85937e4bf735b08f19c7d78f28ae0d669b141be..7a5952e95528a9788bbc1c8ad47ede16b6c299e1 100644 (file)
@@ -1,5 +1,6 @@
 <%
-  var tests = new Array("formtest", "showvars", "include", "session", "loadparm");
+  var tests = new Array("formtest", "showvars", "include", 
+                        "session", "loadparm", "exception");
 %>
 
 <HTML>