1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.seasar.cubby.internal.util;
17
18 import org.seasar.cubby.action.Action;
19 import org.seasar.cubby.action.ActionResult;
20 import org.seasar.cubby.action.Form;
21 import org.seasar.cubby.action.Forward;
22 import org.seasar.cubby.action.Path;
23 import org.seasar.cubby.action.Redirect;
24 import org.seasar.cubby.action.Validation;
25 import org.seasar.cubby.validator.DefaultValidationRules;
26 import org.seasar.cubby.validator.ValidationRules;
27
28 @Path("/")
29 public class MockAction extends Action {
30
31 public ValidationRules validation = new DefaultValidationRules() {
32
33 @Override
34 protected void initialize() {
35 }
36
37 };
38
39 public String attr1;
40 public String attr2;
41 public String attr3;
42 public boolean executedInitalizeMethod = false;
43 public boolean executedPrerenderMethod = false;
44
45 @Override
46 public void initialize() {
47 super.initialize();
48 executedInitalizeMethod = true;
49 }
50
51 @Override
52 public void prerender() {
53 super.prerender();
54 executedPrerenderMethod = true;
55 }
56
57 @Validation(errorPage="error.jsp", rules="validation1")
58 @Form
59 public ActionResult dummy1() {
60 return new Forward("dummy1.jsp");
61 }
62
63 public ActionResult dummy2() {
64 return new Redirect("dummy2");
65 }
66
67 @Validation(errorPage="error.jsp", rules="validation2")
68 @Form
69 public ActionResult dummy3() {
70 return new Forward("dummy1.jsp");
71 }
72
73 @Form
74 public ActionResult index() {
75 return new Forward("dummy1.jsp");
76 }
77
78 @Path("todo/lists")
79 public ActionResult todolist() {
80 return new Forward("dummy1.jsp");
81 }
82
83 @Path("/tasklists")
84 public ActionResult tasklist() {
85 return new Forward("dummy1.jsp");
86 }
87 }