From 72a8868f844f7a15900497915cf507ad908fbce6 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Tue, 13 Jun 2017 14:21:09 +0200 Subject: [PATCH] FreeMarker macros based on HTML output format (requires FreeMarker 2.3.24+) Issue: SPR-14740 --- .../web/servlet/view/freemarker/spring.ftl | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/spring-webmvc/src/main/resources/org/springframework/web/servlet/view/freemarker/spring.ftl b/spring-webmvc/src/main/resources/org/springframework/web/servlet/view/freemarker/spring.ftl index 00ef2e122d..418dda1ebb 100644 --- a/spring-webmvc/src/main/resources/org/springframework/web/servlet/view/freemarker/spring.ftl +++ b/spring-webmvc/src/main/resources/org/springframework/web/servlet/view/freemarker/spring.ftl @@ -1,4 +1,4 @@ -<#ftl strip_whitespace=true> +<#ftl output_format="HTML" strip_whitespace=true> <#-- * spring.ftl * @@ -157,7 +157,7 @@ --> <#macro formInput path attributes="" fieldType="text"> <@bind path/> - ${stringStatusValue}" ${attributes}<@closeTag/> + ${stringStatusValue}" ${attributes?no_esc}<@closeTag/> <#-- @@ -202,7 +202,7 @@ --> <#macro formTextarea path attributes=""> <@bind path/> - @@ -219,14 +219,14 @@ ${stringStatusValue} --> <#macro formSingleSelect path options attributes=""> <@bind path/> - <#if options?is_hash> <#list options?keys as value> - + <#else> <#list options as value> - + @@ -245,10 +245,10 @@ ${stringStatusValue} --> <#macro formMultiSelect path options attributes=""> <@bind path/> - <#list options?keys as value> <#assign isSelected = contains(status.actualValue?default([""]), value)> - + @@ -269,8 +269,8 @@ ${stringStatusValue} <@bind path/> <#list options?keys as value> <#assign id="${status.expression?replace('[','')?replace(']','')}${value_index}"> - checked="checked" ${attributes}<@closeTag/> - ${separator} + checked="checked" ${attributes?no_esc}<@closeTag/> + ${separator} @@ -291,8 +291,8 @@ ${stringStatusValue} <#list options?keys as value> <#assign id="${status.expression?replace('[','')?replace(']','')}${value_index}"> <#assign isSelected = contains(status.actualValue?default([""]), value)> - checked="checked" ${attributes}<@closeTag/> - ${separator} + checked="checked" ${attributes?no_esc}<@closeTag/> + ${separator} @@ -311,7 +311,7 @@ ${stringStatusValue} <#assign id="${status.expression?replace('[','')?replace(']','')}"> <#assign isSelected = status.value?? && status.value?string=="true"> - checked="checked" ${attributes}/> + checked="checked" ${attributes?no_esc}/> <#--