提供一种解决方式,希望帮你解决问题。 <#assign x = "plain"> <#if (x??) && (x?trim?length > 0)> x=${x} </#if> 转载于:https://my.oschina.net/u/3900325/blog/3102050