From 1b53882f554af87b362fc43310ae38119742b5dd Mon Sep 17 00:00:00 2001 From: Rob Winch Date: Mon, 21 Jul 2014 13:09:28 -0500 Subject: [PATCH] Generate bracketless tag id in Velocity forms Before this change if Velocity 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 Velocity Spring form macros generate tag with id that does not contain square brackets. Issue: SPR-5172 --- .../web/servlet/view/velocity/spring.vm | 18 +++--- .../view/velocity/VelocityMacroTests.java | 62 +++++++++++++++++++ .../web/servlet/view/velocity/test-spr5172.vm | 30 +++++++++ 3 files changed, 101 insertions(+), 9 deletions(-) create mode 100644 spring-webmvc/src/test/java/org/springframework/web/servlet/view/velocity/test-spr5172.vm diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/velocity/spring.vm b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/velocity/spring.vm index 159b145117..b89ab04eeb 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/velocity/spring.vm +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/velocity/spring.vm @@ -112,7 +112,7 @@ *# #macro( springFormInput $path $attributes ) #springBind($path) - $!status.value + #end #** @@ -182,7 +182,7 @@ *# #macro( springFormSingleSelect $path $options $attributes ) #springBind($path) - #foreach($option in $options.keySet())