can anybody tell me what am I doing wrong?

I want to retrieve all my alfresco sites with this code (this should work):

model.sites = siteService.listSites(null, null, 0); // return type= List<Site>

And now i want to retrieve this list model.sites in my HTML freemarker template like this:

 <body> ${sites} </body>

How can I view this sites list. I know i am getting it wrong in my ftl, but can't find a solution how to retrieve it.

有帮助吗?

解决方案

You'll need to loop over the sites in your freemarker. Assuming you wanted a list of the site names, with commas between them, then your freemarker would instead want to look something like:

<body>
  <#list sites as site>
     ${site.shortName}<#if site_has_next>,</#if>
  </#list>
</body>
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top