Freemarker - 如果允许在 else 中嵌套(不是常见的 if elseif ... elseif else)
Freemarker - is nested if allowed inside else (not the common if elseif...elseif else)
我不问关于 freemarker 中的常见嵌套(我知道肯定支持):
<#if cond1> do abc
<#elseif cond2> do xxx
<#elseif cond3> do yyy
<#else> do zzz
</#if>
想知道freemarker是否支持下面的嵌套:
<#if cond1> do abc
<#else>
<#if cond-X> do xxx </#if>
<#if cond-Y> do yyy </#if>
<#if cond-Z> do zzz </#if>
</#if>
请注意,我在 else 中有多个 if 条件。
我的代码抛出错误
Error detail: Syntax error in template "template" in line 1282, column 45: Unexpected directive, "</#if>". Check if you have a valid #if-#elseif-#else structure.
所以我怀疑我的架构师提供的后一种嵌套类型。
支持,你显示的内容给我解析成功了。也许错误在别处,或者您没有查看实际处理的模板?
我不问关于 freemarker 中的常见嵌套(我知道肯定支持):
<#if cond1> do abc
<#elseif cond2> do xxx
<#elseif cond3> do yyy
<#else> do zzz
</#if>
想知道freemarker是否支持下面的嵌套:
<#if cond1> do abc
<#else>
<#if cond-X> do xxx </#if>
<#if cond-Y> do yyy </#if>
<#if cond-Z> do zzz </#if>
</#if>
请注意,我在 else 中有多个 if 条件。
我的代码抛出错误
Error detail: Syntax error in template "template" in line 1282, column 45: Unexpected directive, "</#if>". Check if you have a valid #if-#elseif-#else structure.
所以我怀疑我的架构师提供的后一种嵌套类型。
支持,你显示的内容给我解析成功了。也许错误在别处,或者您没有查看实际处理的模板?