cancel
Showing results for 
Search instead for 
Did you mean: 

Java Backed Web Script Example

nm_santos
Champ in-the-making
Champ in-the-making
Hi,

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

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>
10 REPLIES 10

openpj
Elite Collaborator
Elite Collaborator
Please take a look at the Demo WebScript project mentioned here:
http://wiki.alfresco.com/wiki/Java-backed_Web_Scripts_Samples#The_Demo_Web_Scripts

The project is hosted on Google Code at the following address:
http://code.google.com/p/alfresco-java-backed-webscripts-demo/

Hope this helps Smiley Wink