why do sling servlets only work with with a path of /bin/demo/xxx?
I copied a sling servlet which had the path of /bing/demo/querybuilder
I copied a sling servlet which had the path of /bing/demo/querybuilder
Hi @tb3dock
There is an OSGi Configuration named Apache Sling Servlet/Script Resolver and Error Handler in the felix console.
It has a property called "Execution Paths(servletresolver.paths)" which holds a list of absolute paths under which the servlet is accessible as a Resource.
By default bin is allowed in the resolver path which is why it works.
If you want your servlet with /api path to be accessible you will need to allow the path in the resolver paths. Please see the screenshot below:

It is recommended to use resource type based servlet over path based now. Please refer the link below:
https://sling.apache.org/documentation/the-sling-engine/servlets.html
Hope this helps!
Thanks!
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.