I am trying to generate hash value for a javascript file in my java class. Im not able to pass the path of the javascript file to my Java method. Could you please suggest where to store js files and how to access them from my java model?
For example, could someone suggest what path to give for my js script here -
Thanks
Views
Replies
Total Likes
Keep the js file in your project DAM location (example: /content/dam/abc/jsFiles
Read the js file from java logic.
Query: Are you going to modify the js file content from java logic?
no, I just need to read the js file and generate hash 512 for the same to avoid using unsafe-inline in CSP. So this should work?
hi @Silvia_Joyce_Balraj you can save the file in DAM location or etc/clientlibs location. But can you explain the exact business requirement for this. Never came across such ask till now
I need to generate hashes for scripts for CSP
Were the user suggestions helpful? Let us know if more details are needed or mark the answer as correct. If you found a solution independently, please share it with the community.
@Silvia_Joyce_Balraj Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies