Commit f9f05dc 1 parent a6608c1 commit f9f05dc Copy full SHA for f9f05dc
File tree 2 files changed +28
-11
lines changed
org/apache/struts2/components
2 files changed +28
-11
lines changed Original file line number Diff line number Diff line change 20
20
21
21
import java .util .Date ;
22
22
23
-
24
- /**
25
- * TestBean
26
- *
27
- * @author Jason Carreira
28
- * Created Aug 4, 2003 12:39:53 AM
29
- */
30
23
public class TestBean {
31
24
32
25
private Date birth ;
33
26
private String name ;
34
27
private int count ;
35
-
28
+ private String subName ;
29
+
36
30
private TestChildBean child = new TestChildBean ();
37
31
38
32
public TestBean () {
39
33
}
40
34
41
-
42
35
public void setBirth (Date birth ) {
43
36
this .birth = birth ;
44
37
}
@@ -63,13 +56,19 @@ public String getName() {
63
56
return name ;
64
57
}
65
58
66
-
67
59
public TestChildBean getChild () {
68
60
return child ;
69
61
}
70
62
71
-
72
63
public void setChild (TestChildBean child ) {
73
64
this .child = child ;
74
65
}
66
+
67
+ public String getSubName () {
68
+ return subName ;
69
+ }
70
+
71
+ public void setSubName (String subName ) {
72
+ this .subName = subName ;
73
+ }
75
74
}
Original file line number Diff line number Diff line change @@ -136,4 +136,22 @@ public void testPopulateComponentHtmlId7() {
136
136
137
137
assertEquals ("secondAction" , submit .getParameters ().get ("id" ));
138
138
}
139
+
140
+ public void testPopulateComponentHtmlId8 () {
141
+ MockHttpServletRequest req = new MockHttpServletRequest ();
142
+ MockHttpServletResponse res = new MockHttpServletResponse ();
143
+ ValueStack stack = ActionContext .getContext ().getValueStack ();
144
+ TestBean bean = new TestBean ();
145
+ bean .setName ("boo" );
146
+ bean .setSubName ("foo" );
147
+ stack .push (bean );
148
+
149
+ Submit submit = new Submit (stack , req , res );
150
+ submit .setAction ("%{name}" );
151
+ submit .setMethod ("%{subName}" );
152
+
153
+ submit .populateComponentHtmlId (null );
154
+
155
+ assertEquals ("boo_foo" , submit .getParameters ().get ("id" ));
156
+ }
139
157
}
You can’t perform that action at this time.
0 commit comments