Expand my Community achievements bar.

SOLVED

Sling servlet by path and resourceType

Avatar

Level 6

Hi,

 

There are 2 ways we can register our servlet by using path and resoureType.

AEM suggests always try to use resourceType registering servlet.

 

Can any one explain which Scenario is not achieved through resourceType then we we need to go to Path.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @manikanthar1295 

 

As you have mentioned, there are 2 ways to register a servlet (path and resource type). There are many advantages by binding a servlet to a resource type rather than a path discussed here: https://aem.redquark.org/2019/07/sling-servlet-04-registration-via.html

 

Main advantage is Acess control. If you do not want any access control over the servlet you can use PATH based approach.

 

Other use-cases can be the negation of the advantages that resource type can provide.

 

Thanks,

Kiran Vedantam.

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hi @manikanthar1295 

 

As you have mentioned, there are 2 ways to register a servlet (path and resource type). There are many advantages by binding a servlet to a resource type rather than a path discussed here: https://aem.redquark.org/2019/07/sling-servlet-04-registration-via.html

 

Main advantage is Acess control. If you do not want any access control over the servlet you can use PATH based approach.

 

Other use-cases can be the negation of the advantages that resource type can provide.

 

Thanks,

Kiran Vedantam.

Avatar

Community Advisor

Please registered all the servlet by resourceType.

This will allow you to easly manage path permissions thorugh dispatcher and easy to manage all the availble path

and if you are on AMS and AEMaaCS, one of the code quaility rule is not to registered sling servelt by path

https://experienceleague.adobe.com/docs/experience-manager-cloud-manager/using/how-to-use/custom-cod...

 



Arun Patidar