cancel
Showing results for 
Search instead for 
Did you mean: 

How to access the response object in a JS based web script?

mathias_lin
Star Contributor
Star Contributor
Due to the unsolved issues reported here:

- https://forums.alfresco.com/forum/developer-discussions/web-scripts/cors-filter-not-applied-login-we...
- https://forums.alfresco.com/forum/developer-discussions/web-scripts/custom-headers-web-script-041820...

I want to set a header variable within a JavaScript based web script - I do not want to rewrite the entire script in Java as an extension from AbstractWebScript.

I did not find anything in the documentation how to access the response object in a web script. Is it even possible?
2 REPLIES 2

afaust
Legendary Innovator
Legendary Innovator
Hello Mathias,

neither the request nor response object are mapped into parameters for the script execution. The web script runtime only maps request-derived parameters and response is always handled only via 'status' and the response template.

Regards
Axel

hdalang
Champ in-the-making
Champ in-the-making
I suggest that you make a project under /tomcat/webapps/ROOT/ then take the response and add the header you want then send it to your applicaton.

———————————————-
PLEASE IF YOU SAW MY COMMENT IS VERY USEFUL, PLEASE DON'T FORGET TO GIVE USEFUL RATE