01: package elementjava;
02:
03: import com.uwyn.rife.engine.Element;
04:
05: public class simple extends Element {
06: public void processElement() {
07: if (hasSubmission("login")) {
08: print(getParameter("login") + ","
09: + getParameter("password"));
10: } else {
11: if (getInput("input1").equals("form")) {
12: print("<html><body>\n");
13: print("<form action=\""
14: + getSubmissionQueryUrl("login")
15: + "\" method=\"post\">\n");
16: print("<input name=\"login\" type=\"text\">\n");
17: print("<input name=\"password\" type=\"password\">\n");
18: print("<input type=\"submit\">\n");
19: print("</form>\n");
20: print("</body></html>\n");
21: } else {
22: print(new Inner().getOutput());
23: }
24: }
25: }
26:
27: class Inner {
28: public Inner() {
29: }
30:
31: public String getOutput() {
32: return getInput("input1") + "," + getInput("input2");
33: }
34: }
35: }
|