I'm struggling to override the default out of the box json servlet. I want to create my own for a specific resource type and when a specific selector is used. However it seems to keep calling the default. To be clear I want to keep the default servlet in all other scenarios. My annotations for the custom servlet are:
@SlingServlet(methods = {HttpConstants.METHOD_GET},
metatype = true,
resourceTypes = {"wtr/components/structure/offertypepage"},
selectors = {"mapper"},
extensions = {"json"})
and if i call this servlet e.g. /path/to/resource.mapper.json I get an error from the default json servlet complaining that mapper is not a valid selector. IF i switch the extension to html then it works fine...but obviously returning json from .html is not ideal. Also if i called /path/to/resource.2.json then I'd like the normal ootb json servlet to work (ideally).