AnsweredAssumed Answered

Java Backed Web Script Example

Question asked by nm_santos on Jun 1, 2012
Latest reply on Mar 8, 2013 by tbedford
Hi,

I'm following the tutorial located at http://docs.alfresco.com/4.0/topic/com.alfresco.enterprise.doc/tasks/ws-folderListing-Java-scripting.html

after completing all the steps up to the java class, when I try to access the url (After rebooting the server), I always get the following error:

500 Description:    An error inside the HTTP server which prevented it from fulfilling the request.

Message:   05010002 Wrapped Exception (with status template): 05010007 Error during processing of the template 'Expression folder is undefined on line 3, column 19 in org/example/javadir.get.html.ftl.'. Please contact your system administrator.

Exception:   freemarker.core.InvalidReferenceException - Expression folder is undefined on line 3, column 19 in org/example/javadir.get.html.ftl.

Anyone has any idea why?

Here's the javadir.get.html.ftl file:
<html>
<head>
  <title>Folder ${folder.displayPath}/${folder.name}</title>
  </head>
<body>
   Alfresco ${server.edition} Edition v${server.version} : dir
  <p>
  Contents of folder ${folder.displayPath}/${folder.name}
  <p>
  <table>
   <#list folder.children as child>
   <tr>
   <td><#if child.isContainer>d</#if></td>
   <#if verbose>
     <td>${child.properties.modifier}</td>
     <td><#if child.isDocument>
       ${child.properties.content.size}</#if></td>
     <td>${child.properties.modified?date}</td>
   </#if>
   <td>${child.name}</td>
   </tr>
   </#list>
  </table>
</body>
</html>

Outcomes