views:

999

answers:

2

I have a list of string in java code:

List keywords = new ArrayList(); keywords.add("Apple"); keywords.add("Banana");

and I would like to display the keywords using Freemarker: Apple, Banana

How to do that?

PS: I read through the manual and found some articles suggesting using <#list>, but the output is: Apple

Banana

+2  A: 

FreeMarker preserves your spaces (and EOL) but does not add any by itself. So, just put everything in the same line:

<#list myListName as item>${item}</#list>
idrosid
thx idrosid, it works!
Lily
+1  A: 

Freemarker provides some features for whitespace control, see http://freemarker.sourceforge.net/docs/dgui_misc_whitespace.html

skaffman