【发布时间】:2021-11-17 13:28:30
【问题描述】:
我正在使用下面的赋值语句为变量 i_type 赋值。
<#assign i_type>
<#if x.has("type")>
<#if x.type == "ABC">"ABC"<#else>"${x.type?lower_case}"</#if>
<#else>"pqr"</#if>
</#assign>
那我想在ftl转换中赋值一个变量为:
"final_type" : <#if i_type?has_content && i_type == "pqr">1<#else>0</#if>
但在所有情况下,final_type 的值始终为 0。 我明确打印了 i_type 的值,即使它是“pqr”,但条件总是为假。
应该改变什么?
【问题讨论】:
标签: freemarker