Securing servlet | Community
Skip to main content
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by milind_bachani

Hi @aniketp1012 ,

 

PATH based servlet have following disadvantages :

  • path-bound servlets cannot be access controlled using the default JCR repository ACLs
  • path-bound servlets can only be registered to a path and not a resource type (i.e. no suffix handling)
  • if a path-bound servlet is not active, e.g. if the bundle is missing or not started, a POST might result in unexpected results. usually creating a node at /bin/xyz which subsequently overlays the servlets path binding
  • the mapping is not transparent to a developer looking just at the repository

Looking at the ask here, it is recommended to use resourceType based servlet.

Article might help you .

 

Thanks.

2 replies

milind_bachani
milind_bachaniAccepted solution
Employee
March 21, 2022

Hi @aniketp1012 ,

 

PATH based servlet have following disadvantages :

  • path-bound servlets cannot be access controlled using the default JCR repository ACLs
  • path-bound servlets can only be registered to a path and not a resource type (i.e. no suffix handling)
  • if a path-bound servlet is not active, e.g. if the bundle is missing or not started, a POST might result in unexpected results. usually creating a node at /bin/xyz which subsequently overlays the servlets path binding
  • the mapping is not transparent to a developer looking just at the repository

Looking at the ask here, it is recommended to use resourceType based servlet.

Article might help you .

 

Thanks.

Pallavi_Shukla_
New Participant
March 20, 2022

Hi @aniketp1012 

 

The most secure way would be to map the servlet to resource type, AEM would take care of the access part through relevant ACL's

Below is one nice article on this topic that would help you indeed: 

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/secure-sling-servlet-need-suggestions/m-p/417890