I wrote an Alfresco Web Script that renders CSV, it works well.
In a particular case, I want the Web Script to return an error 500 as JSON, so I wrote a .json.500.ftl
template for it.
PROBLEM: The error 500 always shows up as HTML (the default Web Script error template).
What did I do wrong?
My files:
auditlog.get.desc.xml
auditlog.get.csv.ftl
auditlog.get.json.500.ftl
auditlog.get.json.500.ftl
just contains {"error": "abc is not correct"}
auditlog.get.desc.xml
contains:
<webscript>
<shortname>Audit Log Web Script</shortname>
<description>Returns audit data for a given day</description>
<url>/theapp/auditlog</url>
<authentication>admin</authentication>
<format default="csv"></format>
</webscript>
All of these files are in tomcat/webapps/alfresco/WEB-INF/classes/alfresco/extension/templates/webscripts/
and I have restarted Alfresco.