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

SOLVED

Sling servlet by path and resourceType

manikanthar1295
Level 4
Level 4

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
Kiran_Vedantam
Correct answer by
Community Advisor
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
Kiran_Vedantam
Correct answer by
Community Advisor
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

Arun_Patidar
Community Advisor
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...