Forum Discussion
@Doug Does that "Another option you can try is to make your http.client call in your page initialization script then set the result as the value of a request attribute" mean that you can access an Endpoint with FreeMarker from within the page init script??
luk wrote:
@Doug Does that "Another option you can try is to make your http.client call in your page initialization script then set the result as the value of a request attribute" mean that you can access an Endpoint with FreeMarker from within the page init script??
It does not mean you can directly call an endpoint from your components. As AdamN mentioned before, you can call a macro from your page init script, so you could put your http.client logic in that macro and you would be able to call it from your page init script, as well as from an endpoint. If you only need to use it in your page init script, you could put the http.client logic directly in there instead. You would still need to put the result of the http.client call in a request attribute (see the http.request.setAttribute call and the http.request.attributes.name.get call in the http.request freemarker object) in order to access the results in components.
Related Content
- 10 years ago