hi all ,
suppose i have two servlets registered with the same ResourceType .so how will Resource type will select which servlet will serve the request . this is my interview question actully. please answer
Solved! Go to Solution.
Views
Replies
Total Likes
Hello @Shivanandh
In Adobe Experience Manager (AEM), when you have multiple servlets registered with the same resource type, the selection of which servlet will serve the request depends on the OSGi service ranking
OSGi service ranking is a property that can be set when registering a service in AEM. The servlet with the highest service ranking value will be selected to serve the request.
For example, let's say you have two servlets registered with the same resource type:
Servlet A:
- Resource Type: "myapp/components/mycomponent"
- Service Ranking: 100
Servlet B:
- Resource Type: "myapp/components/mycomponent"
- Service Ranking: 200
In this case, Servlet B will be selected to serve the request because it has a higher service ranking value.
Hello @Shivanandh
In Adobe Experience Manager (AEM), when you have multiple servlets registered with the same resource type, the selection of which servlet will serve the request depends on the OSGi service ranking
OSGi service ranking is a property that can be set when registering a service in AEM. The servlet with the highest service ranking value will be selected to serve the request.
For example, let's say you have two servlets registered with the same resource type:
Servlet A:
- Resource Type: "myapp/components/mycomponent"
- Service Ranking: 100
Servlet B:
- Resource Type: "myapp/components/mycomponent"
- Service Ranking: 200
In this case, Servlet B will be selected to serve the request because it has a higher service ranking value.
Thanks @aanchal-sikka for the answer
Views
Replies
Total Likes
@aanchal-sikka is correct, I am just adding the source in case you want to learn more about it. Here https://sling.apache.org/documentation/the-sling-engine/servlets.html#servlet-resolution-order-1
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies