1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package org.apache.struts2;
22
23 import java.util.Arrays;
24 import java.util.Collection;
25 import java.util.List;
26 import java.util.Map;
27
28 import org.apache.struts2.views.jsp.ui.User;
29
30 import com.opensymphony.xwork2.Action;
31 import com.opensymphony.xwork2.ActionSupport;
32
33
34 /***
35 */
36 public class TestAction extends ActionSupport {
37
38 private static final long serialVersionUID = -8891365561914451494L;
39
40 private Collection collection;
41 private Collection collection2;
42 private Map map;
43 private String foo;
44
45 private String result;
46 private User user;
47 private String[] array;
48 private String[][] list;
49 private List list2;
50 private List list3;
51 private SomeEnum status = SomeEnum.COMPLETED;
52
53 public Collection getCollection() {
54 return collection;
55 }
56
57 public void setCollection(Collection collection) {
58 this.collection = collection;
59 }
60
61 public Map getMap() {
62 return map;
63 }
64
65 public void setMap(Map map) {
66 this.map = map;
67 }private Integer fooInt;
68
69 public String getFoo() {
70 return foo;
71 }
72
73 public void setFoo(String foo) {
74 this.foo = foo;
75 }
76
77 public String getResult() {
78 return result;
79 }
80
81 public void setResult(String result) {
82 this.result = result;
83 }
84
85 public User getUser() {
86 return user;
87 }
88
89 public void setUser(User user) {
90 this.user = user;
91 }
92
93 public String[] getArray() {
94 return array;
95 }
96
97 public void setArray(String[] array) {
98 this.array = array;
99 }
100
101 public String[][] getList() {
102 return list;
103 }
104
105 public void setList(String[][] list) {
106 this.list = list;
107 }
108
109 public List getList2() {
110 return list2;
111 }
112
113 public void setList2(List list2) {
114 this.list2 = list2;
115 }
116
117 public void setList3(List list) {
118 this.list3 = list;
119 }
120
121 public List getList3() {
122 return this.list3;
123 }
124
125 public Collection getCollection2() {
126 return this.collection2;
127 }
128
129 public void setCollection2(Collection collection) {
130 this.collection2 = collection;
131 }
132
133 public Integer getFooInt() {
134 return fooInt;
135 }
136
137 public void setFooInt(Integer fooInt) {
138 this.fooInt = fooInt;
139 }
140
141 public String execute() throws Exception {
142 if (result == null) {
143 result = Action.SUCCESS;
144 }
145
146 return result;
147 }
148
149 public String doInput() throws Exception {
150 return INPUT;
151 }
152
153 public SomeEnum getStatus() {
154 return status;
155 }
156
157 public void setStatus(SomeEnum status) {
158 this.status = status;
159 }
160
161 public List<SomeEnum> getStatusList() {
162 return Arrays.asList(SomeEnum.values());
163 }
164
165 }