01: /*
02: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General Public License, v2.1 or later
06: * $Id: GeneratedurlPathinfo.java 3634 2007-01-08 21:42:24Z gbevin $
07: */
08: package com.uwyn.rife.engine.testelements.submission;
09:
10: import com.uwyn.rife.engine.Element;
11: import com.uwyn.rife.template.Template;
12:
13: public class GeneratedurlPathinfo extends Element {
14: public void processElement() {
15: print(getPathInfo());
16: if (hasSubmission("submission1")) {
17: print(getParameter("parameter"));
18: } else if (hasSubmission("submission2")
19: && !isParameterEmpty("login")
20: && !isParameterEmpty("password")) {
21: print(getParameter("login") + ","
22: + getParameter("password"));
23: } else if (hasSubmission("submission3")
24: && !isParameterEmpty("login")
25: && !isParameterEmpty("password")) {
26: print(getParameter("login") + ","
27: + getParameter("password"));
28: } else if (hasSubmission("submission4")) {
29: print("submission4");
30: } else {
31: Template template = getHtmlTemplate("engine_submissionurl_generation");
32:
33: setSubmissionQuery(template, "submission1", new String[] {
34: "parameter", "thevalue" });
35: setSubmissionForm(template, "submission3", new String[] {
36: "password", "it is" });
37:
38: print(template);
39: }
40: }
41: }
|