View Javadoc

1   /*
2    * $Id: TestAction.java 508509 2007-02-16 17:35:12Z hermanns $
3    *
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *  http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  package org.apache.struts2;
22  
23  import java.util.Collection;
24  import java.util.List;
25  import java.util.Map;
26  
27  import org.apache.struts2.views.jsp.ui.User;
28  
29  import com.opensymphony.xwork2.Action;
30  import com.opensymphony.xwork2.ActionSupport;
31  
32  
33  /***
34   */
35  public class TestAction extends ActionSupport {
36  
37      private static final long serialVersionUID = -8891365561914451494L;
38  
39      private Collection collection;
40      private Collection collection2;
41      private Map map;
42      private String foo;
43  
44      private String result;
45      private User user;
46      private String[] array;
47      private String[][] list;
48      private List list2;
49      private List list3;
50  
51      public Collection getCollection() {
52          return collection;
53      }
54  
55      public void setCollection(Collection collection) {
56          this.collection = collection;
57      }
58  
59      public Map getMap() {
60          return map;
61      }
62  
63      public void setMap(Map map) {
64          this.map = map;
65      }private Integer fooInt;
66  
67      public String getFoo() {
68          return foo;
69      }
70  
71      public void setFoo(String foo) {
72          this.foo = foo;
73      }
74  
75      public String getResult() {
76          return result;
77      }
78  
79      public void setResult(String result) {
80          this.result = result;
81      }
82  
83      public User getUser() {
84          return user;
85      }
86  
87      public void setUser(User user) {
88          this.user = user;
89      }
90  
91      public String[] getArray() {
92          return array;
93      }
94  
95      public void setArray(String[] array) {
96          this.array = array;
97      }
98  
99      public String[][] getList() {
100         return list;
101     }
102 
103     public void setList(String[][] list) {
104         this.list = list;
105     }
106 
107     public List getList2() {
108         return list2;
109     }
110 
111     public void setList2(List list2) {
112         this.list2 = list2;
113     }
114 
115     public void setList3(List list) {
116         this.list3 = list;
117     }
118 
119     public List getList3() {
120         return this.list3;
121     }
122 
123     public Collection getCollection2() {
124         return this.collection2;
125     }
126 
127     public void setCollection2(Collection collection) {
128         this.collection2 = collection;
129     }
130 
131     public Integer getFooInt() {
132         return fooInt;
133     }
134 
135     public void setFooInt(Integer fooInt) {
136         this.fooInt = fooInt;
137     }
138     
139     public String execute() throws Exception {
140         if (result == null) {
141             result = Action.SUCCESS;
142         }
143 
144         return result;
145     }
146 
147     public String doInput() throws Exception {
148         return INPUT;
149     }
150 
151 }