How to Allow ClientLib that is under /apps.. component level in Dispatcher.any file | Community
Skip to main content
tushaar_srivastava
Level 6
January 29, 2020
Solved

How to Allow ClientLib that is under /apps.. component level in Dispatcher.any file

  • January 29, 2020
  • 1 reply
  • 3905 views

Hi,

As previously we were creating clientLibs under /etc/designs, and to allow these styles in dispatcher : we use to allow something like

# design and template assets
/0050 { /type "allow" /glob "GET /etc/designs/*" }

# collected JS/CSS from the components and design
/0051 { /type "allow" /glob "GET /etc/clientlibs/*" }

 

 Now, since we moved all the clientLibs specific to component level.

exmaple:  /apps/myproject/clientLibs or /apps/myproject2/clientLibs2 or /apps/myproject3/clientLibs3

 

In that case how to allow all the clientlibs in dispatcher.any file, ClientLibs i.e. under the /apps folder to different different component.

 

Thanks

 

@kautuk_sahni  @arunpatidar 

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 Asutosh_Jena_

Hi @tushaar_srivastava ,

 

Clientlibs under /apps should have the "allowProxy" property and will be invoked via a proxy servlet.
It is recommended to locate client libraries under /apps and expose them via /etc.clientlibs by leveraging the allowProxy property.

So if the file is like /apps/projects/clientlibs/base/resources/icon.png then it will be accessed via /etc.clientlibs/projects/clientlibs/base/resources/icon.png

 

Along with this you will need to add the below rules in dispatcher.

  1. under filter section allow the below path:
    /0002 { /type "allow" /url "/etc.clientlibs/*" }
  2. under rules section allow the below paths:
    /0001 { /glob "/etc.clientlibs/*.css" /type "allow" }
    /0002 { /glob "/etc.clientlibs/*.js" /type "allow" }

Please refer the below link for more details:

https://docs.adobe.com/content/help/en/experience-manager-65/developing/introduction/clientlibs.html#locating-a-client-library-folder-and-using-the-proxy-client-libraries-servlet

 

Thanks,

Asutosh

1 reply

Asutosh_Jena_
Community Advisor
Asutosh_Jena_Community AdvisorAccepted solution
Community Advisor
January 29, 2020

Hi @tushaar_srivastava ,

 

Clientlibs under /apps should have the "allowProxy" property and will be invoked via a proxy servlet.
It is recommended to locate client libraries under /apps and expose them via /etc.clientlibs by leveraging the allowProxy property.

So if the file is like /apps/projects/clientlibs/base/resources/icon.png then it will be accessed via /etc.clientlibs/projects/clientlibs/base/resources/icon.png

 

Along with this you will need to add the below rules in dispatcher.

  1. under filter section allow the below path:
    /0002 { /type "allow" /url "/etc.clientlibs/*" }
  2. under rules section allow the below paths:
    /0001 { /glob "/etc.clientlibs/*.css" /type "allow" }
    /0002 { /glob "/etc.clientlibs/*.js" /type "allow" }

Please refer the below link for more details:

https://docs.adobe.com/content/help/en/experience-manager-65/developing/introduction/clientlibs.html#locating-a-client-library-folder-and-using-the-proxy-client-libraries-servlet

 

Thanks,

Asutosh

kautuk_sahni
Community Manager
Community Manager
June 29, 2020
@asutosh_jena_ Wonderful response.
Kautuk Sahni