multiple servlets with same resource type
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
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
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.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.