cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot write Java-backed Webscript without a Template

pyppe
Champ in-the-making
Champ in-the-making
Hi.

I'm trying to write a Java-backed Web Script that would write the response directly – without using a Freemarker Template. I've followed the instructions here http://wiki.alfresco.com/wiki/Java-backed_Web_Scripts_Samples#Writing_the_Web_Script_.28Java.29, but if I define <format default="">argument</format>, and try to call the web script, I get the following Exception:

Web Script format '' is not registered

If I define <format default="json">argument</format>, I get the following exception:

java.io.FileNotFoundException - Template sample.get.json.ftl not found.

I've extended class AbstractWebScript, which according to documentation would mean that no template is needed. How can this be done?

Thanks!

Pyppe
2 REPLIES 2

pmonks
Star Contributor
Star Contributor
What happens if you leave the <format> element out of your descriptor?

Cheers,
Peter

pyppe
Champ in-the-making
Champ in-the-making
The problem was in my package structure. The webscript bean I had defined had id that did not match with the Java package of my WebScript class.

Consider this issue solved. Thanks, and sorry! Smiley Happy