Call SlingServlet without using /bin in sling.servlet.paths | Community
Skip to main content
avantikas293534
Level 2
Jul 10, 2019 11:39 AM UTC

Call SlingServlet without using /bin in sling.servlet.paths

Hi All,

I am using "sling.servlet.paths=" + "/bin/xyz" to call my servlet using ajax. Is there any way to do it without using /bin i.e. "sling.servlet.paths=" + "/xyz" ? If yes, what are the steps that I need to follow to implement it.

Thanks

Avantika

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

3 replies

joerghoh
Employee
Jul 10, 2019 7:35 PM UTC

Please do not bind servlets to a path. Instead you should bind the servlet to a resourceType. See AEM coding best practice: Servlets | Things on a content management system

Jörg

Translate
Ravi_Pampana
New Participant
Jul 10, 2019 7:04 PM UTC

Hi,

You can also use selectors in your servlet so that you can be independent of path and more efficient than paths

sling.servlet.selectors

http://www.aemcq5tutorials.com/tutorials/sling-servlet-in-aem/

Translate
arunpatidar
New Participant
Jul 10, 2019 2:20 PM UTC

Add your path in Execution Paths property in below osgi config

Apache Sling Servlet/Script Resolver and Error Handler

Translate
Arun Patidar