AnsweredAssumed Answered

Java backed bean not called

Question asked by gbur on Dec 12, 2008
Latest reply on Jan 3, 2009 by pmonks

I have a problem with a java backed web script configuration, I use alfresco 3.0

this is my module-context.xml :

<?xml version='1.0' encoding='UTF-8'?>


    <bean id=""


the simple.get.desc.xml :

  <shortname>The World's Simplest Webscript</shortname>
  <description>Hands back a little bit of JSON</description>
  <format default="html">argument</format>

Freemarker template


Java class

package org.alfresco.module.demoscripts;

import java.util.HashMap;
import java.util.Map;

import org.alfresco.web.scripts.DeclarativeWebScript;
import org.alfresco.web.scripts.WebScriptRequest;
import org.alfresco.web.scripts.WebScriptStatus;

public class SimpleWebScript extends DeclarativeWebScript
   protected Map<String, Object> executeImpl(WebScriptRequest req, WebScriptStatus status)
      Map<String, Object> model = new HashMap<String, Object>();
      model.put("res", "My result");

      return model;

this is the error in th standard Tomcat output :
15:40:01,379 ERROR [freemarker.runtime]

Expression node is undefined on line 2, column 4 in simple.get.html.ftl.
The problematic instruction:
==> ${res} [on line 2, column 4 in simple.get.html.ftl]

what's wrong with my configuration ?

if someone can send me an example of a java backed web script working on Alfresco 3.0 !!