Difference bw these two urls | 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 Dipti_Chauhan

Hi @preeti5 

  It is always advisable is to use relative path instead of absolute path so that sling  will look for the resources first under /apps(helpful in case of overlay)and then under /libs .

Detailed description you will find here : https://aemmastery.com/aem-osgi-service-dive-resource-resolver-factory-c2521f75be51

 

Thanks

Dipti

2 replies

Dipti_Chauhan
Community Advisor
Dipti_ChauhanCommunity AdvisorAccepted solution
Community Advisor
September 13, 2021

Hi @preeti5 

  It is always advisable is to use relative path instead of absolute path so that sling  will look for the resources first under /apps(helpful in case of overlay)and then under /libs .

Detailed description you will find here : https://aemmastery.com/aem-osgi-service-dive-resource-resolver-factory-c2521f75be51

 

Thanks

Dipti

Preeti5
Preeti5Author
Level 2
September 13, 2021

Heya @dipti_chauhan 

Thankyou 

Ritesh_Mittal
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
September 13, 2021

Hi @preeti5 ,

 

Lets understand the resource resolution concept, by default the sling looks for any script under '/apps' and then '/libs' (of course if you have not modified "Apache Sling Resource Resolver Factory").

 

Now when you specify resource path, that can be

 

1. Absolute path - means you will specify either /apps* or /libs* path

2. Relative path - you do not append anything (/apps or /libs) and let Sling do its job

 

Now, why it is recommended to use relative path, just consider you have used /libs* and in future someone in your team creates an overlay (means modified script version under /apps*) then you have to modified all references where you have put script path as /libs.

 

Hope it clarifies!

 

More-

https://aemmastery.com/aem-osgi-service-dive-resource-resolver-factory-c2521f75be51