AnsweredAssumed Answered

Java-backed web script

Question asked by sihnu on Mar 30, 2015
Latest reply on Mar 30, 2015 by sihnu

I've been working now with java-backed web script because I need some data manipulation I can't achieve with JavaScript. I followed these instructions So I've tried to implement SimpleWebScript with Java. I implemented the -context file to load the bean, the JAR file and description file and deployed them all to the server in the locations described in the guide. The webscript is loaded and recognized but when I call the url I got error message template file is missing. The webscript is not actually using any template. It should just write some simple JSON and that's all. I think my webscript is not running the execute method I've defined in my Java class. I'm quite sure about that. I've been trying to understand how the web script is actually supposed to call the method and I can't figure that out. How Alfresco knows what method inside which class it is supposed to call?

To make things easier for you here is the code:


public class SimpleWebScript extends AbstractWebScript
    public void execute(WebScriptRequest req, WebScriptResponse res)
        throws IOException

<bean id="" 

  <shortname>The World's Simplest Webscript</shortname>
  <description>Hands back a little bit of JSON</description>
  <format default="">argument</format>
  <family>Alfresco Java-Backed WebScripts Demo</family>

And this is the error message I get when calling the webscript:

<blockquote>Cannot locate template processor for template org/alfresco/demo/simple.get.html</blockquote>