Execution flow of web scripts
Let's first understand the execution flow of web scripts in order to understand the Alfresco web script framework.
Overall flow for a web script
As soon as a request for the web script URI is hit, the execution flow of the web script gets started and continues till the request gets served with the requested response format. Let's understand the overall execution flow for a web script with a JavaScript-backed controller. The whole execution flow is as follows:
A request for the web script URI arrives at the web script request dispatcher in Alfresco.
The request dispatcher sends the request to the Web Script Runtime.
The Web Script Runtime delegates the request to The Web Script Container, which will first find the suitable web script for the requested URI and the requested HTTP method.
The next thing would be to authenticate the user first, if required, before executing the web script.
The Web Script Container then executes the controller implementation if available...