문제

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