Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

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

tushaar_srivastava
Level 4
Level 4

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  @Arun_Patidar 

Clientlib.min.css Dispatcher dispatcher.any
1 Accepted Solution
asutosh_jena
Correct answer by
Community Advisor
Community Advisor

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...

 

Thanks,

Asutosh

View solution in original post

2 Replies
asutosh_jena
Correct answer by
Community Advisor
Community Advisor

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...

 

Thanks,

Asutosh

View solution in original post