mirror of
https://github.com/apache/struts.git
synced 2026-08-07 15:46:57 +00:00
Adds test to guard pre-evaulation of name attribute
This commit is contained in:
@@ -281,4 +281,20 @@ public class TextfieldTest extends AbstractUITagTest {
|
||||
verify(TextFieldTag.class.getResource("Textfield-11.txt"));
|
||||
}
|
||||
|
||||
public void testNameEvaluation() throws Exception {
|
||||
TestAction testAction = (TestAction) action;
|
||||
testAction.setArray(new String[]{"test", "bar"});
|
||||
testAction.setFooInt(1);
|
||||
|
||||
TextFieldTag tag = new TextFieldTag();
|
||||
tag.setPageContext(pageContext);
|
||||
tag.setName("array[%{fooInt}]");
|
||||
|
||||
tag.doStartTag();
|
||||
tag.doEndTag();
|
||||
|
||||
verify(TextFieldTag.class.getResource("Textfield-12.txt"));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
<tr>
|
||||
<td class="tdLabel"></td>
|
||||
<td><input type="text" name="array[1]" value="bar" id="array_1_"/></td>
|
||||
</tr>
|
||||
Reference in New Issue
Block a user