I have an application where a lot of webscript are listing always the same json output (an array of documents and their properties). So, i need to have different business logic that renders always the same output.
So, i'm copying over and over the same webscript.get.json.ftl file for every webscript.
Is there any way to reuse the same freemarker file for output ?
I'm afraid you can't without modifying webscript framework source code. Since a lot of webscript share the same json output,I guess there should be a lot common in them.Why not try to combine them in to one or several webscipts ?
You can simply declare one macro in one ftl file which renders the json output and you can call this macro by including that ftl file in any of your response ftl file.
You can have a look at OOB file "person.get.json.ftl && person.lib.ftl" for your reference.