The Java – freemaker template checks whether the sequence is empty

I want to check whether the sequence is empty in the freemaker template

This fragment is used to check whether the sequence contains values:

<#if node.attachments?seq_contains("blue")>
  <pre>hello</pre>
</#if>

However, if node Attachments is empty. I want to do something else

Is that the grammar of this?

Solution

This job

< #if node. attachments? size!= 0>

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>