Skip to content

Commit 4c60f39

Browse files
committed
WW-5352 Enable annotations for showcase
1 parent 5d79301 commit 4c60f39

File tree

11 files changed

+52
-14
lines changed

11 files changed

+52
-14
lines changed

apps/showcase/src/main/java/org/apache/struts2/showcase/UITagExample.java

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,15 @@
2424
import com.opensymphony.xwork2.Validateable;
2525
import com.opensymphony.xwork2.util.ValueStack;
2626
import org.apache.struts2.ServletActionContext;
27+
import org.apache.struts2.interceptor.parameter.StrutsParameter;
2728

2829
import java.io.File;
29-
import java.util.*;
30+
import java.util.ArrayList;
31+
import java.util.Collections;
32+
import java.util.Date;
33+
import java.util.HashMap;
34+
import java.util.List;
35+
import java.util.Map;
3036

3137
/**
3238
*/
@@ -89,6 +95,7 @@ public List getLeftSideCartoonCharacters() {
8995
return leftSideCartoonCharacters;
9096
}
9197

98+
@StrutsParameter
9299
public void setLeftSideCartoonCharacters(List leftSideCartoonCharacters) {
93100
this.leftSideCartoonCharacters = leftSideCartoonCharacters;
94101
}
@@ -98,6 +105,7 @@ public List getRightSideCartoonCharacters() {
98105
return rightSideCartoonCharacters;
99106
}
100107

108+
@StrutsParameter
101109
public void setRightSideCartoonCharacters(List rightSideCartoonCharacters) {
102110
this.rightSideCartoonCharacters = rightSideCartoonCharacters;
103111
}
@@ -107,6 +115,7 @@ public String getFavouriteVehicalType() {
107115
return favouriteVehicalType;
108116
}
109117

118+
@StrutsParameter
110119
public void setFavouriteVehicalType(String favouriteVehicalType) {
111120
this.favouriteVehicalType = favouriteVehicalType;
112121
}
@@ -115,6 +124,7 @@ public String getFavouriteVehicalSpecific() {
115124
return favouriteVehicalSpecific;
116125
}
117126

127+
@StrutsParameter
118128
public void setFavouriteVehicalSpecific(String favouriteVehicalSpecific) {
119129
this.favouriteVehicalSpecific = favouriteVehicalSpecific;
120130
}
@@ -145,6 +155,7 @@ public String getName() {
145155
return name;
146156
}
147157

158+
@StrutsParameter
148159
public void setName(String name) {
149160
this.name = name;
150161
}
@@ -153,6 +164,7 @@ public Date getBirthday() {
153164
return birthday;
154165
}
155166

167+
@StrutsParameter
156168
public void setBirthday(Date birthday) {
157169
this.birthday = birthday;
158170
}
@@ -161,6 +173,7 @@ public String getBio() {
161173
return bio;
162174
}
163175

176+
@StrutsParameter
164177
public void setBio(String bio) {
165178
this.bio = bio;
166179
}
@@ -169,6 +182,7 @@ public String getFavouriteColor() {
169182
return favouriteColor;
170183
}
171184

185+
@StrutsParameter
172186
public void setFavouriteColor(String favoriteColor) {
173187
this.favouriteColor = favoriteColor;
174188
}
@@ -177,6 +191,7 @@ public List getFriends() {
177191
return friends;
178192
}
179193

194+
@StrutsParameter
180195
public void setFriends(List friends) {
181196
this.friends = friends;
182197
}
@@ -193,6 +208,7 @@ public boolean isLegalAge() {
193208
return legalAge;
194209
}
195210

211+
@StrutsParameter
196212
public void setLegalAge(boolean legalAge) {
197213
this.legalAge = legalAge;
198214
}
@@ -201,6 +217,7 @@ public String getState() {
201217
return state;
202218
}
203219

220+
@StrutsParameter
204221
public void setState(String state) {
205222
this.state = state;
206223
}
@@ -209,6 +226,7 @@ public String getRegion() {
209226
return region;
210227
}
211228

229+
@StrutsParameter
212230
public void setRegion(String region) {
213231
this.region = region;
214232
}
@@ -229,6 +247,7 @@ public void setPictureFileName(String pictureFileName) {
229247
this.pictureFileName = pictureFileName;
230248
}
231249

250+
@StrutsParameter
232251
public void setFavouriteLanguage(String favouriteLanguage) {
233252
this.favouriteLanguage = favouriteLanguage;
234253
}
@@ -237,7 +256,7 @@ public String getFavouriteLanguage() {
237256
return favouriteLanguage;
238257
}
239258

240-
259+
@StrutsParameter
241260
public void setThoughts(String thoughts) {
242261
this.thoughts = thoughts;
243262
}
@@ -250,6 +269,7 @@ public Date getWakeup() {
250269
return wakeup;
251270
}
252271

272+
@StrutsParameter
253273
public void setWakeup(Date wakeup) {
254274
this.wakeup = wakeup;
255275
}

apps/showcase/src/main/java/org/apache/struts2/showcase/action/SkillAction.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import com.opensymphony.xwork2.Preparable;
2222
import org.apache.logging.log4j.LogManager;
2323
import org.apache.logging.log4j.Logger;
24+
import org.apache.struts2.interceptor.parameter.StrutsParameter;
2425
import org.apache.struts2.showcase.dao.Dao;
2526
import org.apache.struts2.showcase.dao.SkillDao;
2627
import org.apache.struts2.showcase.model.Skill;
@@ -71,6 +72,7 @@ protected Dao getDao() {
7172
return skillDao;
7273
}
7374

75+
@StrutsParameter(depth = 1)
7476
public Skill getCurrentSkill() {
7577
return currentSkill;
7678
}

apps/showcase/src/main/java/org/apache/struts2/showcase/async/ChatRoomAction.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
package org.apache.struts2.showcase.async;
2020

2121
import com.opensymphony.xwork2.ActionSupport;
22+
import org.apache.struts2.interceptor.parameter.StrutsParameter;
2223

2324
import java.util.ArrayList;
2425
import java.util.List;
@@ -34,10 +35,12 @@ public class ChatRoomAction extends ActionSupport {
3435

3536
private static final List<String> messages = new ArrayList<>();
3637

38+
@StrutsParameter
3739
public void setMessage(String message) {
3840
this.message = message;
3941
}
4042

43+
@StrutsParameter
4144
public void setLastIndex(Integer lastIndex) {
4245
this.lastIndex = lastIndex;
4346
}

apps/showcase/src/main/java/org/apache/struts2/showcase/conversion/AddressAction.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
package org.apache.struts2.showcase.conversion;
2222

2323
import com.opensymphony.xwork2.ActionSupport;
24+
import org.apache.struts2.interceptor.parameter.StrutsParameter;
2425

2526
import java.util.LinkedHashSet;
2627
import java.util.Set;
@@ -30,7 +31,7 @@
3031
*/
3132
public class AddressAction extends ActionSupport {
3233

33-
private Set<Address> addresses = new LinkedHashSet<Address>();
34+
private Set<Address> addresses = new LinkedHashSet<>();
3435

3536
public String input() throws Exception {
3637
return SUCCESS;
@@ -41,6 +42,7 @@ public String submit() throws Exception {
4142
return SUCCESS;
4243
}
4344

45+
@StrutsParameter(depth = 2)
4446
public Set<Address> getAddresses() {
4547
return addresses;
4648
}

apps/showcase/src/main/java/org/apache/struts2/showcase/conversion/OperationsEnumAction.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
package org.apache.struts2.showcase.conversion;
2222

2323
import com.opensymphony.xwork2.ActionSupport;
24+
import org.apache.struts2.interceptor.parameter.StrutsParameter;
2425

2526
import java.util.Arrays;
2627
import java.util.LinkedList;
@@ -47,6 +48,7 @@ public List<OperationsEnum> getSelectedOperations() {
4748
return this.selectedOperations;
4849
}
4950

51+
@StrutsParameter
5052
public void setSelectedOperations(List<OperationsEnum> selectedOperations) {
5153
this.selectedOperations = selectedOperations;
5254
}

apps/showcase/src/main/java/org/apache/struts2/showcase/conversion/PersonAction.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
package org.apache.struts2.showcase.conversion;
2222

2323
import com.opensymphony.xwork2.ActionSupport;
24+
import org.apache.struts2.interceptor.parameter.StrutsParameter;
2425

2526
import java.util.List;
2627

@@ -36,6 +37,7 @@ public String submit() throws Exception {
3637
return SUCCESS;
3738
}
3839

40+
@StrutsParameter(depth = 2)
3941
public List<Person> getPersons() {
4042
return persons;
4143
}

apps/showcase/src/main/java/org/apache/struts2/showcase/filedownload/FileDownloadAction.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
import com.opensymphony.xwork2.Action;
2424
import org.apache.struts2.ServletActionContext;
25+
import org.apache.struts2.interceptor.parameter.StrutsParameter;
2526

2627
import java.io.InputStream;
2728

@@ -38,6 +39,7 @@ public String execute() throws Exception {
3839
return SUCCESS;
3940
}
4041

42+
@StrutsParameter
4143
public void setInputPath(String value) {
4244
inputPath = sanitizeInputPath(value);
4345
}

apps/showcase/src/main/java/org/apache/struts2/showcase/fileupload/FileUploadAction.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import com.opensymphony.xwork2.ActionSupport;
2424
import org.apache.struts2.action.UploadedFilesAware;
2525
import org.apache.struts2.dispatcher.multipart.UploadedFile;
26+
import org.apache.struts2.interceptor.parameter.StrutsParameter;
2627

2728
import java.util.List;
2829

@@ -65,6 +66,7 @@ public String getCaption() {
6566
return caption;
6667
}
6768

69+
@StrutsParameter
6870
public void setCaption(String caption) {
6971
this.caption = caption;
7072
}

apps/showcase/src/main/java/org/apache/struts2/showcase/validation/FieldValidatorsExampleAction.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
*/
2121
package org.apache.struts2.showcase.validation;
2222

23+
import org.apache.struts2.interceptor.parameter.StrutsParameter;
24+
2325
import java.sql.Date;
2426

2527
/**
@@ -44,6 +46,7 @@ public Date getDateValidatorField() {
4446
return dateValidatorField;
4547
}
4648

49+
@StrutsParameter
4750
public void setDateValidatorField(Date dateValidatorField) {
4851
this.dateValidatorField = dateValidatorField;
4952
}
@@ -52,6 +55,7 @@ public String getEmailValidatorField() {
5255
return emailValidatorField;
5356
}
5457

58+
@StrutsParameter
5559
public void setEmailValidatorField(String emailValidatorField) {
5660
this.emailValidatorField = emailValidatorField;
5761
}
@@ -60,6 +64,7 @@ public Integer getIntegerValidatorField() {
6064
return integerValidatorField;
6165
}
6266

67+
@StrutsParameter
6368
public void setIntegerValidatorField(Integer integerValidatorField) {
6469
this.integerValidatorField = integerValidatorField;
6570
}
@@ -68,6 +73,7 @@ public String getRegexValidatorField() {
6873
return regexValidatorField;
6974
}
7075

76+
@StrutsParameter
7177
public void setRegexValidatorField(String regexValidatorField) {
7278
this.regexValidatorField = regexValidatorField;
7379
}
@@ -76,6 +82,7 @@ public String getRequiredStringValidatorField() {
7682
return requiredStringValidatorField;
7783
}
7884

85+
@StrutsParameter
7986
public void setRequiredStringValidatorField(String requiredStringValidatorField) {
8087
this.requiredStringValidatorField = requiredStringValidatorField;
8188
}
@@ -84,6 +91,7 @@ public String getRequiredValidatorField() {
8491
return requiredValidatorField;
8592
}
8693

94+
@StrutsParameter
8795
public void setRequiredValidatorField(String requiredValidatorField) {
8896
this.requiredValidatorField = requiredValidatorField;
8997
}
@@ -92,6 +100,7 @@ public String getStringLengthValidatorField() {
92100
return stringLengthValidatorField;
93101
}
94102

103+
@StrutsParameter
95104
public void setStringLengthValidatorField(String stringLengthValidatorField) {
96105
this.stringLengthValidatorField = stringLengthValidatorField;
97106
}
@@ -100,6 +109,7 @@ public String getFieldExpressionValidatorField() {
100109
return fieldExpressionValidatorField;
101110
}
102111

112+
@StrutsParameter
103113
public void setFieldExpressionValidatorField(
104114
String fieldExpressionValidatorField) {
105115
this.fieldExpressionValidatorField = fieldExpressionValidatorField;
@@ -109,6 +119,7 @@ public String getUrlValidatorField() {
109119
return urlValidatorField;
110120
}
111121

122+
@StrutsParameter
112123
public void setUrlValidatorField(String urlValidatorField) {
113124
this.urlValidatorField = urlValidatorField;
114125
}

apps/showcase/src/main/java/org/apache/struts2/showcase/wait/LongProcessAction.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
package org.apache.struts2.showcase.wait;
2222

2323
import com.opensymphony.xwork2.ActionSupport;
24+
import org.apache.struts2.interceptor.parameter.StrutsParameter;
2425

2526
/**
2627
* Example to illustrate the <code>execAndWait</code> interceptor.
@@ -41,6 +42,7 @@ public int getTime() {
4142
return time;
4243
}
4344

45+
@StrutsParameter
4446
public void setTime(int time) {
4547
this.time = time;
4648
}

0 commit comments

Comments
 (0)