これが私のtestMacro.txt
<#macro myMacro value1 value2>
<#list 1..value1 as x>
<#if x=value1>
<#switch value2>
<#case value2 = 1>
CASE1
<#break>
<#case value2 =2 >
CASE2
<#break>
<#case value2 = 3>
CASE3
<#break>
</#switch>
<#else>
ELSE
</#if>
</#list>
<@myMacro value1=3 value2=1 />
これが私が受けている例外です。
Exception in thread "main" java.lang.RuntimeException: freemarker.template.TemplateException: The only legal comparisons are between two numbers, two strings, or two dates.
Left hand operand is a freemarker.template.SimpleNumber
Right hand operand is a freemarker.template.TemplateBooleanModel$2
これはswitchcaseステートメントにありますが、例外には行番号は示されていませんが、switchステートメントにコメントし、例外はなかったので、caseステートメントに問題があると結論付けています。
親切に助けてください。