How to configure a servlet via resource type?
There are several tutorials on creating sling servlets. All of them use paths, e.g.
"sling.servlet.paths=" + "/bin/readjson"
(and this can be hit on www.mysite.com/bin/readjason )
All of them say its better to use resource types, e.g.
"sling.servlet.resourceTypes="+ "noidea",
but how do I hit the servlet? www.mysite.com/noidea doesnt work.
What needs to be setup, and how, to use a resource type (and setup in source code - not in the local running AEM instance, where it cannot be distributed to other instances)? Presumably there is some configuration somewhere which ties the resource type to a URL.
If you have an API with say 20 endpoints, so you have say 20 URLs, its easy to give each one its own path in the servlet directly, e.g. /bin/api/login or /bin/api/register. This concept doesn't really map onto resource type, as you would have to manually create a resource type for each endpoint, and there may be 100 endpoints in some APIs. We assume selector could be used, or may be postfix, but the documentation implies sector should only be used to define how the result should be formatted, not what the URL endpoint is?