Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

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

avantikas293534
Level 2
Level 2

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

3 Replies
Arun_Patidar
Community Advisor
Community Advisor

Add your path in Execution Paths property in below osgi config

Apache Sling Servlet/Script Resolver and Error Handler

Ravi_Pampana
Community Advisor
Community Advisor

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/

Jörg_Hoh
Employee
Employee

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