solved: I was extending the DeclarativeWebScript class without a freemarker template. It seems that the only way to work without freemarker template is by extending the AbstractWebScript class. If somebody can confirm that ? Thanks, Vincent
Declarativewebscript and Abstractwebscript both are the helper classes provided by the alfresco webscript framework for developing java backed webscripts in alfresco. Declarativewebscript provides execution assistance for the webscript and allows to building up the model object as required to render in the FTL template, possible to redirection based on error status codes etc. Webscript controller java class has to extend DeclarativeWebscript and override executeImpl method for using it. ftl template is required in this case.
About AbstractWebScript, it gives full control to the extending controller class to render the response and hence ftl template not required. DeclarativeWebscript is a good example of using this control provided by AbstractWebScript. It extends AbstractWebScript only and provides the mechanism to render the response through model object. In the scenarios like streaming the content extending AbstractWebScript class can be used. However, generally for creating java backed webscript, DeclarativeWebscript is used.
Yes ,if you extend the DeclarativeWebScript class, a freemarker template is needed. Although you can extend the AbstractWebScript class without freemarker template,I don't think it is a good approcach,because under certain circumstances template is still needed (for exmaple if your webscript need to support redirection). So I suggest you still extend the DeclarativeWebScript class and provide a freemarker template.