Post Webscript Error

cancel
Showing results for 
Search instead for 
Did you mean: 
Active Member

Post Webscript Error

i wrote a simple post java backed webscript

String user = "admin";
user = req.getParameter("user");

model.put("user", user)
return model;

but every time I try it with : curl -X POST "http://localhost:8080/alfresco/s/test/hello.json?user=joey&guest=true"
I get this message error :

FreeMarker template error:
The following has evaluated to null or missing:
==> node [in template "test.post.json.ftl" at line 3, column 22]

Tip: If the failing expression is known to be legally null/missing, either specify a default value with myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthessis: (myOptionVar.foo)!myDefault, (myOptionVar.foo)??

The failing instruction (FTL stack trace):
----------
==> ${node} [in template "test.post.json.ftl" at line 3, column 20]
----------

this is my test.post.json.ftl file :

{"test" :
{
"user" : "${user}"
}
}

1 Reply
Highlighted
Established Member II

Re: Post Webscript Error

Hello,

You have a deployment problem beacause the template that your webscript is parsing have this text ${node}  in the line 3. 

You can check in the Alfresco WebScripts Home (http://localhost:8080/alfresco/s/index/uri/) the info of your custom service (http://localhost:8080/alfresco/s/index/uri/test/hello).

Regards