Expand my Community achievements bar.

SOLVED

Difference bw these two urls

Avatar

Level 2

20210913_153107.jpg

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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

View solution in original post

3 Replies

Avatar

Correct answer by
Community Advisor

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

Avatar

Community Advisor

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