I copied a sling servlet which had the path of /bing/demo/querybuilder
Solved! Go to Solution.
Views
Replies
Total Likes
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!
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!
Views
Replies
Total Likes
Views
Replies
Total Likes
hello, it is mainly for security and processing of request correctly, as i noticed. but apart from /bin you can also implement your servlet using resource type and selector like below
@SlingServlet(resourceTypes = "site/components/mypage",
selectors = "myselector",
extensions = "html",
methods = "GET",
metatype =true)
Thanks!!
Views
Likes
Replies
Views
Like
Replies
Views
Likes
Replies