From my java code I'm returning a Set<String>. The view needs to check if the Set contains a specific string.. I can't find any docs on how Freemarker can handle this.
Any idea?
views:
23answers:
1
A:
The following should do it. You need FreeMarker 2.3.1
${x?seq_contains("blue")?string("yes", "no")}
This will output yes if the sequence contains "blue".
Here is the doco about it Built-ins for sequences
Iain
2010-10-28 08:12:16
this works <#if mySet?seq_contains("myString")>
al nik
2010-10-28 08:27:48