Generate bracketless tag id in FreeMarker forms
Before this change if FreeMarker Spring form macro was bound to a path which contains square brackets, those brackets would also appear in id of generated tag, making the id invalid. As of this fix all FreeMarker Spring form macros generate tag with id that does not contain square brackets. Issue: SPR-8732
This commit is contained in:
@@ -260,6 +260,11 @@ public class FreeMarkerMacroTests {
|
||||
assertTrue("Wrong output: " + output, output.contains("<input type=\"checkbox\" id=\"jedi\" name=\"jedi\" checked=\"checked\" />"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testForm17() throws Exception {
|
||||
assertEquals("<input type=\"text\" id=\"spouses0.name\" name=\"spouses[0].name\" value=\"Fred\" >", getMacroOutput("FORM17"));
|
||||
}
|
||||
|
||||
private String getMacroOutput(String name) throws Exception {
|
||||
|
||||
String macro = fetchMacro(name);
|
||||
|
||||
@@ -86,3 +86,6 @@ FORM15
|
||||
|
||||
FORM16
|
||||
<@spring.formCheckbox "command.jedi"/>
|
||||
|
||||
FORM17
|
||||
<@spring.formInput "command.spouses[0].name", ""/>
|
||||
|
||||
Reference in New Issue
Block a user